[PATCH] share: make bookmark sharing default
Ryan McElroy
rm at fb.com
Tue Dec 2 20:48:04 UTC 2014
# HG changeset patch
# User Ryan McElroy <rmcelroy at fb.com>
# Date 1417552751 28800
# Tue Dec 02 12:39:11 2014 -0800
# Node ID 5058edfef772ef7f2b04b551e40660e2614088de
# Parent 167c39d171778dadf2c1256f2294493e6ec6a241
share: make bookmark sharing default
Everyone I've talked to prefered this to be the default, so let's make it so.
diff --git a/hgext/share.py b/hgext/share.py
--- a/hgext/share.py
+++ b/hgext/share.py
@@ -15,16 +15,14 @@
testedwith = 'internal'
@command('share',
- [('U', 'noupdate', None, _('do not create a working copy')),
- ('B', 'bookmarks', None, _('share bookmarks with source repository')),
- ],
- _('[-U] [-B] SOURCE [DEST]'),
+ [('U', 'noupdate', None, _('do not create a working copy'))],
+ _('[-U] SOURCE [DEST]'),
norepo=True)
def share(ui, source, dest=None, noupdate=False, bookmarks=False):
"""create a new shared repository
Initialize a new repository and working directory that shares its
- history with another repository.
+ history and bookmarks with another repository.
.. note::
@@ -38,7 +36,7 @@
the broken clone to reset it to a changeset that still exists.
"""
- return hg.share(ui, source, dest, not noupdate, bookmarks)
+ return hg.share(ui, source, dest, not noupdate)
@command('unshare', [], '')
def unshare(ui, repo):
diff --git a/mercurial/hg.py b/mercurial/hg.py
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -158,7 +158,7 @@
return ''
return os.path.basename(os.path.normpath(path))
-def share(ui, source, dest=None, update=True, bookmarks=False):
+def share(ui, source, dest=None, update=True, bookmarks=True):
'''create a shared repository'''
if not islocal(source):
diff --git a/tests/test-share.t b/tests/test-share.t
--- a/tests/test-share.t
+++ b/tests/test-share.t
@@ -131,7 +131,7 @@
test sharing bookmarks
- $ hg share -B repo1 repo3
+ $ hg share repo1 repo3
updating working directory
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cd repo1
@@ -141,6 +141,7 @@
$ cd ../repo2
$ hg book bm2
$ hg bookmarks
+ bm1 2:c2e0ac586386
* bm2 3:0e6e70d1d5f1
$ cd ../repo3
$ hg bookmarks
@@ -212,7 +213,7 @@
test behavior when sharing a shared repo
- $ hg share -B repo3 repo5
+ $ hg share repo3 repo5
updating working directory
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cd repo5
More information about the Mercurial-devel
mailing list