diff mercurial/bookmarks.py @ 29354:af849596752c

bookmarks: abort 'push -B .' when no active bookmark
author liscju <piotr.listkiewicz@gmail.com>
date Mon, 13 Jun 2016 23:50:26 +0200
parents f92afd23a099
children 0a3b11a7489a
line wrap: on
line diff
--- a/mercurial/bookmarks.py	Mon Jun 13 05:11:56 2016 +0900
+++ b/mercurial/bookmarks.py	Mon Jun 13 23:50:26 2016 +0200
@@ -17,6 +17,7 @@
 )
 from . import (
     encoding,
+    error,
     lock as lockmod,
     obsolete,
     util,
@@ -154,7 +155,10 @@
 
     def expandname(self, bname):
         if bname == '.':
-            return self.active
+            if self.active:
+                return self.active
+            else:
+                raise error.Abort(_("no active bookmark"))
         return bname
 
 def _readactive(repo, marks):