[PATCH] bookmarks: add 'hg push -B .' for pushing the active bookmark (issue4917)
Sean Farley
sean at farley.io
Fri Feb 19 17:00:00 EST 2016
liscju <piotr.listkiewicz at gmail.com> writes:
> # HG changeset patch
> # User liscju <piotr.listkiewicz at gmail.com>
> # Date 1455917289 -3600
> # Fri Feb 19 22:28:09 2016 +0100
> # Node ID 7f68decb8bceff4c6da47cb02cf8ca56c538cee5
> # Parent a036e1ae1fbe88ab99cb861ebfc2e4da7a3912ca
> bookmarks: add 'hg push -B .' for pushing the active bookmark (issue4917)
>
> diff -r a036e1ae1fbe -r 7f68decb8bce mercurial/bookmarks.py
> --- a/mercurial/bookmarks.py Sun Feb 07 00:49:31 2016 -0600
> +++ b/mercurial/bookmarks.py Fri Feb 19 22:28:09 2016 +0100
> @@ -182,6 +182,12 @@
> fp.write("%s %s\n" % (hex(node), encoding.fromlocal(name)))
> self._clean = True
>
> + def expandname(self, bname):
> + if bname == '.':
> + return self.active
> + else:
> + return bname
Stylistic nit: we usually specify this as:
if bname == '.':
return self.active
return bname
but I would just let someone fix that in-flight. Looks good otherwise.
More information about the Mercurial-devel
mailing list