[PATCH 2 of 8 V2] revset: add a utility for obtaining the source of a given rev

Matt Mackall mpm at selenic.com
Wed Jun 20 13:13:11 CDT 2012


On Fri, 2012-06-08 at 00:58 -0400, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_harbison at yahoo.com>
> # Date 1338942934 14400
> # Node ID 356bb037ddc0c9ee510cb46e379bc715bce9e139
> # Parent  e01c0a7fc5fdd197150500b4845e53634d196db4
> revset: add a utility for obtaining the source of a given rev

Queued for default with some hacking.

> +    try:
> +        for label in ('source', 'transplant_source', 'rebase_source'):
> +            src = extra.get(label)
> +
> +            if src is not None:
> +                return repo[src].rev()
> +
> +    except error.RepoLookupError:
> +        pass

This became:

+    for label in ('source', 'transplant_source', 'rebase_source'):
+        if label in extra:
+            try:
+                return repo[extra[label]].rev()
+            except error.RepoLookupError:
+                pass

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list