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

Kevin Bullock kbullock+mercurial at ringworld.org
Thu Feb 24 16:56:47 CST 2011


On Feb 24, 2011, at 6:41 AM, David Soria Parra wrote:

> -----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.

Okay, I'll take a swing at that and re-send the series.

>>         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.


I was about to say it's probably more -likely- to have '/' appear in a bookmark than a tag, but now that I think about it, hg-git uses a combination of bookmarks, tags, and local tags to mirror git refs. So I think it's at least no less worse. :)

pacem in terris / mir / shanti / salaam / heiwa
Kevin R. Bullock



More information about the Mercurial-devel mailing list