divergent @ bookmark (was Re: [PATCH] clone: update to @ bookmark if it exists)

Matt Mackall mpm at selenic.com
Mon Oct 15 17:04:44 CDT 2012


On Mon, 2012-10-15 at 16:36 -0500, Augie Fackler wrote:
> On Oct 15, 2012, at 2:04 PM, Kevin Bullock <kbullock+mercurial at ringworld.org> wrote:
> 
> > On Oct 15, 2012, at 7:29 AM, David M. Carr wrote:
> > 
> >> If the @ bookmark is divergent when pulling from remote "foo", do we
> >> want the divergent bookmark stored as "@foo" or "@@foo"?  The code
> >> currently appears to be using "@@foo".  I think that the double @ sign
> >> looks sort of weird and would have expected the other behavior.
> >> 
> >> I suppose the argument in favor of the double @ sign in this case is
> >> that it's more consistent.  Whatever the bookmark name is, you append
> >> an @ sign to express that it's a divergent bookmark, and then include
> >> an identifier to distinguish which remote it refers to.  Reading
> >> "@foo" with that mindset would tell you that it's a divergent ""
> >> (empty string) bookmark for the remote "foo", which isn't accurate.
> >> 
> >> That being said, I don't think most users will think it through like
> >> that.  They'll see the double @ sign and assume it's a bug without
> >> further thought.  I think that "@foo" is a perfectly fine way to
> >> represent the concept of "the default bookmark at the remote foo".
> > 
> > 
> > I'd be in favor of dropping the doubled '@'. ISTR Matt was in favor as well. Patches welcome as always :) It'd be good to straighten this out before 2.4 (which is coming soon, yikes!)
> 
> I'm happy to dedicate Friday as a 20% hg hacking day. Matt, does dropping the @@ shenanigans seem Right for 2.4?

Yes, but I'm planning to freeze on Thursday or so. Is more needed than
this?

diff -r 9837cafc25b1 mercurial/bookmarks.py
--- a/mercurial/bookmarks.py	Sat Oct 13 15:10:39 2012 -0500
+++ b/mercurial/bookmarks.py	Mon Oct 15 17:04:09 2012 -0500
@@ -214,6 +214,8 @@
                     changed = True
                     ui.status(_("updating bookmark %s\n") % k)
                 else:
+                    if k == '@':
+                        k = ''
                     # find a unique @ suffix
                     for x in range(1, 100):
                         n = '%s@%d' % (k, x)

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list