Comments
Patch
@@ -5370,7 +5370,8 @@
If -B/--bookmark is used, the specified bookmarked revision, its
ancestors, and the bookmark will be pushed to the remote
- repository.
+ repository. Specifying ``.`` is equivalent to specifying the active
+ bookmark's name.
Please see :hg:`help urls` for important details about ``ssh://``
URLs. If DESTINATION is omitted, a default path will be used.
@@ -5380,6 +5381,20 @@
if opts.get('bookmark'):
ui.setconfig('bookmarks', 'pushing', opts['bookmark'], 'push')
+ activebookmark = repo._activebookmark
+ if '.' in opts['bookmark'] and activebookmark is None:
+ raise error.Abort(_('no bookmark is active'),
+ hint=_('do not specify \'.\' in bookmarks'))
+
+ def expandactivebookmark(b):
+ if b == '.':
+ return activebookmark
+ else:
+ return b
+
+ opts.update([(
+ 'bookmark',
+ [expandactivebookmark(x) for x in opts['bookmark']])])
for b in opts['bookmark']:
# translate -B options to -r so changesets get pushed
if b in repo._bookmarks:
@@ -103,6 +103,29 @@
deleting remote bookmark W
[1]
+export the active bookmark
+
+ $ hg bookmark V
+ $ hg push -B . ../a
+ pushing to ../a
+ searching for changes
+ no changes found
+ exporting bookmark V
+ [1]
+
+delete the bookmark
+
+ $ hg book -d V
+ $ hg push -B V ../a
+ pushing to ../a
+ searching for changes
+ no changes found
+ deleting remote bookmark V
+ [1]
+ $ hg up foobar
+ 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ (activating bookmark foobar)
+
push/pull name that doesn't exist
$ hg push -B badname ../a