@@ -420,20 +420,31 @@
def incoming(ui, repo, other):
ui.status(_("searching for changed bookmarks\n"))
- def write(b, id):
- ui.write(" %-25s %s\n" %
- (b, ui.debugflag and id or id[:12]))
+ def write(b, id, opt, msg):
+ ui.write(" %-25s %s (%s) %s\n" %
+ (b, ui.debugflag and id or id[:12], opt, msg))
return True
def addsrc(b, scid, dcid):
- return write(b, scid)
+ return write(b, scid, '-', _('added remotely'))
+ def advsrc(b, scid, dcid):
+ return write(b, scid, '-', _('advanced remotely'))
+ def advdst(b, scid, dcid):
+ return write(b, scid, 'B', _('advanced locally'))
+ def diverge(b, scid, dcid):
+ return write(b, scid, '@', _('diverged'))
+ def differ(b, scid, dcid):
+ return write(b, scid, '?', _('changed'))
if not _execactions(compare(repo,
other.listkeys('bookmarks'), repo._bookmarks,
dsthex=hex),
{'addsrc': addsrc,
+ 'advsrc': advsrc,
+ 'advdst': advdst,
+ 'diverge': diverge,
+ 'differ': differ,
},
- ignore=set(['adddst', 'advsrc', 'advdst',
- 'diverge','differ'])):
+ ignore=set(['adddst'])):
ui.status(_("no changed bookmarks found\n"))
return 1
return 0
@@ -3843,6 +3843,27 @@
See pull for valid source format details.
+ .. container:: verbose
+
+ With -B/--bookmarks, the result of bookmark comparison between
+ local and remote repositories is displayed as follows::
+
+ BM1 01234567890a (-) advanced remotely
+ BM2 1234567890ab (B) advanced locally
+ BM3 234567890abc (@) diverged
+ BM4 34567890abcd (?) changed
+
+ Each lines consist of four columns: "bookmark name", "remote
+ value", "action at pulling" and "detail of difference".
+
+ "action at pulling" column shows about bookmark updating in the
+ local repository by marks below:
+
+ :``-``: updated or added implicitly
+ :``B``: not updated implicitly (use -B to update forcibly)
+ :``@``: same as ``B`` except for implicit creation of diverged one
+ :``?``: undefined, because remote revision is unknown for local
+
Returns 0 if there are incoming changes, 1 otherwise.
"""
if opts.get('graph'):
@@ -362,9 +362,11 @@
$ hg in -B http://localhost:$HGPORT/
comparing with http://localhost:$HGPORT/
searching for changed bookmarks
- Z 0d2164f0ce0d
- foo 000000000000
- foobar 9b140be10808
+ @ 9b140be10808 (@) diverged
+ X 9b140be10808 (@) diverged
+ Z 0d2164f0ce0d (-) added remotely
+ foo 000000000000 (-) added remotely
+ foobar 9b140be10808 (-) added remotely
$ hg pull -B Z http://localhost:$HGPORT/
pulling from http://localhost:$HGPORT/
no changes found
@@ -191,7 +191,7 @@
$ hg in -B
comparing with ssh://user@dummy/remote
searching for changed bookmarks
- foo a28a9d1a809c
+ foo a28a9d1a809c (-) added remotely
$ hg book -f -r 0 foo
$ hg pull -B foo
pulling from ssh://user@dummy/remote