hg annotate does not follow renaming via hg mv

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

hg annotate does not follow renaming via hg mv

Uwe Brauer

Hi

Please look at

hg init
echo "First" > test.org
hg add test.org
hg commit  -m "First"
echo "Second" >> test.org
hg commit  -m "Second"
echo "Third" >> test.org
hg commit  -m "Third"
echo "Forth" >> test.org
hg commit  -m "Forth"
hg annotate test.org -r 3
hg mv test.org testnew.org
hg commit  -m "Renamed file test.org to testnew.org"
hg annotate testnew.org -r 3

The last command fails since testnew.org was not in rev3 (it was but
with a different name). I hoped hg annotate would following renaming but
it does not or what do I miss.


Hg help annotate

Tells me

--no-follow           don't follow copies and renames

So I understand the default behavior is to follow.

I, unfortunately do a lot of renaming and hg annotate is very helpful.

Regards

Uwe Brauer

_______________________________________________
Mercurial mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial
Reply | Threaded
Open this post in threaded view
|

[Matt Mackals idea] (was: hg annotate does not follow renaming via hg mv)

Uwe Brauer
>>> "UB" == Uwe Brauer <[hidden email]> writes:

   > Hi


   > The last command fails since testnew.org was not in rev3 (it was but
   > with a different name). I hoped hg annotate would following renaming but
   > it does not or what do I miss.


   > Hg help annotate

   > Tells me

   > --no-follow           don't follow copies and renames

   > So I understand the default behavior is to follow.

I just found out about
https://www.mercurial-scm.org/pipermail/mercurial/2012-March/042407.html

,----
| But we might eventually implement something like:
|
|  hg annotate -r 2519^ "set:follow(somefile)"
`----

But as far as I can see this was never done. Am I right?

_______________________________________________
Mercurial mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial

smime.p7s (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

[anti revert?] (was: hg annotate does not follow renaming via hg mv)

Uwe Brauer
In reply to this post by Uwe Brauer
>>> "UB" == Uwe Brauer <[hidden email]> writes:

It seems the best strategy for using hg annotate in the case of renaming is:

    1. Use hg log -r "adds('**')" --template "{rev}:\n{file_copies % '{file_copy}\n'}\n"

    2. Say its result is testnew.org (test.org)

    3. Then I run say hg annotate newfile.org

    4. I do hg revert test.org -r 3

    5. And run hg annotate on test.org

    6. Continue if there were more renamings

However then I might have a lot of files I obtained via hg revert
how can I simply delete them, hg purge is not the right one?

    1. Hg up -C

    2. Hg purge

Would work, but if I have some changes I better run hg shelve.
Nothing faster?

hg anti-revert

Regards

Uwe Brauer



_______________________________________________
Mercurial mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial

smime.p7s (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [anti revert?]

Uwe Brauer
>>> "UB" == Uwe Brauer <[hidden email]> writes:

>>> "UB" == Uwe Brauer <[hidden email]> writes:
   > It seems the best strategy for using hg annotate in the case of renaming is:

   >     1. Use hg log -r "adds('**')" --template "{rev}:\n{file_copies % '{file_copy}\n'}\n"

   >     2. Say its result is testnew.org (test.org)

   >     3. Then I run say hg annotate newfile.org

   >     4. I do hg revert test.org -r 3

This is nonsense, hg annotate does not work this way. It should be
hg up -r 3.

Please ignore the question

_______________________________________________
Mercurial mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial

smime.p7s (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Matt Mackals idea]

Pierre-Yves David-2
In reply to this post by Uwe Brauer
I don't know the specific of Matt proposal, but I remember that Denis
Laxalde did some work about following piece of code that might match
your need.

(I put him in CC.)

On 7/26/20 7:16 PM, Uwe Brauer wrote:

>>>> "UB" == Uwe Brauer <[hidden email]> writes:
>
>     > Hi
>
>
>     > The last command fails since testnew.org was not in rev3 (it was but
>     > with a different name). I hoped hg annotate would following renaming but
>     > it does not or what do I miss.
>
>
>     > Hg help annotate
>
>     > Tells me
>
>     > --no-follow           don't follow copies and renames
>
>     > So I understand the default behavior is to follow.
>
> I just found out about
> https://www.mercurial-scm.org/pipermail/mercurial/2012-March/042407.html
>
> ,----
> | But we might eventually implement something like:
> |
> |  hg annotate -r 2519^ "set:follow(somefile)"
> `----
>
> But as far as I can see this was never done. Am I right?
>
>
> _______________________________________________
> Mercurial mailing list
> [hidden email]
> https://www.mercurial-scm.org/mailman/listinfo/mercurial
>

--
Pierre-Yves David
_______________________________________________
Mercurial mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial
Reply | Threaded
Open this post in threaded view
|

hgweb.cgi requires encoded config string?

Harald Klimach
In reply to this post by Uwe Brauer
Hi,

I ran into a problem with hgweb.cgi in Mercurial 5.3.2 with Python 3.7.7
on OpenBSD 6.7: It complained that mercurial only accepts encoded strings.
I fixed this by adding a .encode("utf-8") to the config string, but this
is not mentioned in the hgweb.cgi template installed along with
Mercurial 5.3.2, and it looks this is also not the case in the latest
repository version of hgweb.cgi.

I just changed
application = hgweb(config)
to
application = hgweb(config.encode("utf-8"))

Is this the correct approach? And if so, wouldn't it be appropriate to
suggest something similar in the hgweb.cgi file?

Thanks,
Harald
_______________________________________________
Mercurial mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial
Reply | Threaded
Open this post in threaded view
|

Re: [Matt Mackals idea]

Uwe Brauer
In reply to this post by Pierre-Yves David-2

   > I don't know the specific of Matt proposal, but I remember that Denis
   > Laxalde did some work about following piece of code that might match
   > your need.

Thanks, I appreciate that.

_______________________________________________
Mercurial mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial

smime.p7s (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Fwd: hgweb.cgi requires encoded config string?

Harald Klimach-2
In reply to this post by Harald Klimach
Hi,

ran into this problem a few ago aswell, see below.
I'm using the cgi script, but I guess you need to do something similar.

Best,
Harald


-------- Weitergeleitete Nachricht --------
Betreff: hgweb.cgi requires encoded config string?
Datum: Wed, 29 Jul 2020 12:09:35 +0200
Von: Harald Klimach <[hidden email]>
An: [hidden email]

Hi,

I ran into a problem with hgweb.cgi in Mercurial 5.3.2 with Python 3.7.7
on OpenBSD 6.7: It complained that mercurial only accepts encoded strings.
I fixed this by adding a .encode("utf-8") to the config string, but this
is not mentioned in the hgweb.cgi template installed along with
Mercurial 5.3.2, and it looks this is also not the case in the latest
repository version of hgweb.cgi.

I just changed
application = hgweb(config)
to
application = hgweb(config.encode("utf-8"))

Is this the correct approach? And if so, wouldn't it be appropriate to
suggest something similar in the hgweb.cgi file?

Thanks,
Harald
_______________________________________________
Mercurial mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial
_______________________________________________
Mercurial mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial
Reply | Threaded
Open this post in threaded view
|

Re: hgweb.cgi requires encoded config string?

David Demelier-2
In reply to this post by Harald Klimach

> On 29 Jul 2020, at 12:09, Harald Klimach <[hidden email]> wrote:
>
> Hi,
>
> I ran into a problem with hgweb.cgi in Mercurial 5.3.2 with Python 3.7.7
> on OpenBSD 6.7: It complained that mercurial only accepts encoded strings.
> I fixed this by adding a .encode("utf-8") to the config string, but this
> is not mentioned in the hgweb.cgi template installed along with
> Mercurial 5.3.2, and it looks this is also not the case in the latest
> repository version of hgweb.cgi.
>
> I just changed
> application = hgweb(config)
> to
> application = hgweb(config.encode("utf-8"))
>
> Is this the correct approach? And if so, wouldn't it be appropriate to
> suggest something similar in the hgweb.cgi file?
>
> Thanks,
> Harald

My guess is that OpenBSD does not play well with locales AFAIR. I don’t need this parameter on FreeBSD but FreeBSD exposes en_US.UTF-8 locale completely.

Is there a command locale on OpenBSD? If yes can you show it?

Or maybe this is because OpenBSD’s mercurial uses python 3? my FreeBSD version still uses python 2.

Regards,

_______________________________________________
Mercurial mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial