Mercurial > public > mercurial-scm > hg-stable
diff mercurial/bookmarks.py @ 15614:260a6449d83a
bookmarks: mark divergent bookmarks with book@pathalias when source in [paths]
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Wed, 07 Dec 2011 16:19:39 -0600 |
parents | 2fad18f15409 |
children | 013688350c7d |
line wrap: on
line diff
--- a/mercurial/bookmarks.py Tue Dec 06 14:17:33 2011 -0600 +++ b/mercurial/bookmarks.py Wed Dec 07 16:19:39 2011 -0600 @@ -177,7 +177,7 @@ finally: w.release() -def updatefromremote(ui, repo, remote): +def updatefromremote(ui, repo, remote, path): ui.debug("checking for updated bookmarks\n") rb = remote.listkeys('bookmarks') changed = False @@ -194,10 +194,17 @@ changed = True ui.status(_("updating bookmark %s\n") % k) else: + # find a unique @ suffix for x in range(1, 100): n = '%s@%d' % (k, x) if n not in repo._bookmarks: break + # try to use an @pathalias suffix + # if an @pathalias already exists, we overwrite (update) it + for p, u in ui.configitems("paths"): + if path == u: + n = '%s@%s' % (k, p) + repo._bookmarks[n] = cr.node() changed = True ui.warn(_("divergent bookmark %s stored as %s\n") % (k, n))