[PATCH 2 of 2] id: add bookmarks to id

David Soria Parra dsoria at gmx.net
Thu Feb 24 06:41:30 CST 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 24.02.2011 03:48, Kevin Bullock wrote:
> # HG changeset patch
> # User Kevin Bullock <kbullock at ringworld.org>
> # Date 1298070548 21600
> # Branch stable
> # Node ID 6a71bc58c67669d7c0e205bb0f6c4cee4d51a1a1
> # Parent  0357458cca79624d79a84896067c43020e5170a5
> id: add bookmarks to id

Thanks. Just a few remarks.

>      revs = []
> @@ -2277,9 +2277,9 @@
>              rev = revs[0]
>          if not rev:
>              rev = "tip"
> -        if num or branch or tags:
> -            raise util.Abort(
> -                "can't query remote revision number, branch, or tags")
> +        if num or branch or tags or bookmarks:
> +            raise util.Abort("can't query remote revision number,"
> +                             " branch, tags, or bookmarks")

We can lookup bookmarks using repo.listkeys('bookmarks'). We do this in
hg summary for example, so I think we should do this in identify too.

>          output = [hexfunc(repo.lookup(rev))]
>      elif not rev:
>          ctx = repo[None]
> @@ -2310,12 +2310,20 @@
>          if t:
>              output.append(t)
>  
> +        # multiple bookmarks for a single parent separated by '/'
> +        bm = '/'.join(ctx.bookmarks())
> +        if bm:
> +            output.append(bm)
> +

Just a note: / is allowed in bookmarks, this might confuse people in the
output if you happen to have bookmark like 'dsp/impl-summary'.
I'm aware that / is allowed in tags, so we probably can just go and use
/ to separate bookmarks as well as we use it to separate tags.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJNZlH6AAoJEAT0aMuPE7Z1v2UP/jKcQcZN5sJWoyPkgy4xo6up
/sBA+chE9H4G6njlXcvhwpYlwNgymf89COkmYS6EnoXrdHTpsF+1Y/n2JflIB4xO
YwJiawd2EPu2ofoGS7ZsuZCNkVpvfymD/k87ZD3hvJYK5xMZ18gSTpjEWJtWIWa8
hJJ+qpJv/yNwP2D8kEQsGaB8ODTqRHNdwKbsGeK61lM7j85UyxhB4XxXH1jZ8CDH
nQvIU7FSI3/r89yz/XVREYaeBa24Nbi58blHaHX0DceQrOKg6znOhh03lidnYp2h
sWPoWEN/8diNTlLwwAneJJA0Bq53HXW4WSCFYYhB5m+4NxSZWV66a5g7myW9ys4E
AioijY5lFzRZLV0nruJQsv33RGAiJmrcxZ2F+Uo9EJoFhccAMbC/7WXuLcARzxQX
EYbqgC5skayINA+c+Z+yRmpFAqVVVe4zwPiKlbPTvmyD3WnYBGqI7lCYkeSjX+Ju
czFhbJ9WnbKafF5QZWYT4DRgqkuBthHYgj4KIK0tPkaB76IF0BJkybtBLjmUHILQ
HNB+lp0pv0GMI09XFtmSBh+4N9k/Jf5dz+c+pjcx3gFkdt8ChoBcNkXoluSZWH3+
ahRIsDIRqhshf4qQ/Brpx8+VYhAFPctBhoWIg8YE7c7yA0DFrQ+4shwgE0lUrOLo
BELSdbDzB4/qWBJC1143
=bFnZ
-----END PGP SIGNATURE-----


More information about the Mercurial-devel mailing list