[PATCH RESEND] histedit: select the lowest rev when looking for a root in a revset

Augie Fackler raf at durin42.com
Tue Mar 18 11:14:50 CDT 2014


Looks totally reasonable, but please write a test before I accept this.


On Mon, Mar 17, 2014 at 1:10 PM, David Soria Parra <davidsp at fb.com> wrote:

> # HG changeset patch
> # User David Soria Parra <davidsp at fb.com>
> # Date 1394751906 25200
> #      Thu Mar 13 16:05:06 2014 -0700
> # Node ID 882b4e7f82a01f62c1ae23e0700a2a23d35498d1
> # Parent  c152e538b85b099ce20b51104b8b7dd3666aad7c
> histedit: select the lowest rev when looking for a root in a revset
>
> When we specify a revision or a revset we just get the last element from
> the
> list. For revsets this can lead to unintended effects where you specify a
> revset like only() but instead histedit selects the highest revision in the
> set as root. Therefore we should always use the lowest revision number as
> root.
>
> diff --git a/hgext/histedit.py b/hgext/histedit.py
> --- a/hgext/histedit.py
> +++ b/hgext/histedit.py
> @@ -565,7 +565,7 @@
>                  remote = None
>              root = findoutgoing(ui, repo, remote, force, opts)
>          else:
> -            root = revs[0]
> +            root = 'min(%s)' % revs[0]
>              root = scmutil.revsingle(repo, root).node()
>
>          keep = opts.get('keep', False)
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20140318/704721f1/attachment.html>


More information about the Mercurial-devel mailing list