Previous revision

Martin Geisler mg at lazybytes.net
Sun Jun 21 11:56:07 CDT 2009


Greg Ward <greg-hg at gerg.ca> writes:

> """
> parentrevspec extension - use suffixes to refer to ancestor revisions
>
> This extension allows you to use git-style suffixes to refer to the
> ancestors of a specific revision.
>
> For example, if you can refer to a revision as "foo", then:
>
> - foo^N = Nth parent of foo
>   foo^0 = foo
>   foo^1 = first parent of foo
>   foo^2 = second parent of foo
>   foo^  = foo^1
>
> - foo~N = Nth first grandparent of foo
>   foo~0 = foo
>   foo~1 = foo^1 = foo^ = first parent of foo
>   foo~2 = foo^1^1 = foo^^ = first parent of first parent of foo
> """
>
> Enable it like any other extension, and off you go.
>
> (Hmmm: another good argument in favour of the just-proposed patch to
> make unconfigured extensions more discoverable through the help.)
>
> (Hmmm #2: really, why is this an extension? How painful/expensive
> would it be to move this syntax into core Mercurial?

Not very, I think. The bigger problem is to figure out what we need and
to select a good syntax for it.

There has been talk about syntax for obtaining:

* changeset ranges following the changeset graph. In a repository where
  work on two unnamed branches has been interleaved like this

    [0] --- [1] --- [3]
       \
        `------ [2] --- [4]

  a range like 1:3 gives 1, 2, and 3 and there is no syntax for getting
  just 1 and 3.

  Maybe a::b could mean "descendants of a" intersect "ancestors of b",
  which I think is the best way to express "the stuff between a and b".

* the parent(s) of a changeset. The a^ syntax might be good enough.

* maybe something that will let you find the root of the current
  (unnamed) branch -- rebase finds this when you do a rebase after a
  pull. If we call the changeset 'a', I guess the definition is
  "ancestors of a" setminus "ancestors of heads other than a".

Hopefully we can also get *combinations* of the above. Being able to
combine operators in a mini-language is what will make this feature grow
as we add new operators.

See also:

  http://markmail.org/message/msc77e7p6zsk2mgn

-- 
Martin Geisler

VIFF (Virtual Ideal Functionality Framework) brings easy and efficient
SMPC (Secure Multiparty Computation) to Python. See: http://viff.dk/.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://selenic.com/pipermail/mercurial-devel/attachments/20090621/91a98fb6/attachment.pgp 


More information about the Mercurial-devel mailing list