Patchwork [3,of,3,V4] share: make sharing bookmarks the default

login
register
mail settings
Submitter Ryan McElroy
Date Dec. 13, 2014, 11:38 p.m.
Message ID <0d9a8bde037771a7df44.1418513936@devbig105.prn2.facebook.com>
Download mbox | patch
Permalink /patch/7080/
State Not Applicable
Delegated to: Matt Mackall
Headers show

Comments

Ryan McElroy - Dec. 13, 2014, 11:38 p.m.
# HG changeset patch
# User Ryan McElroy <rmcelroy@fb.com>
# Date 1418500432 28800
#      Sat Dec 13 11:53:52 2014 -0800
# Node ID 0d9a8bde037771a7df443b0c79d84d01e4d26aa2
# Parent  171b35bf7af924443ac66ebc0d874081b835dd82
share: make sharing bookmarks the default

Patch

diff --git a/hgext/share.py b/hgext/share.py
--- a/hgext/share.py
+++ b/hgext/share.py
@@ -16,14 +16,14 @@  testedwith = 'internal'
 
 @command('share',
     [('U', 'noupdate', None, _('do not create a working copy')),
-     ('B', 'bookmarks', None, _('also share bookmarks'))],
-    _('[-U] [-B] SOURCE [DEST]'),
+     ('', 'nobookmarks', None, _('do not share bookmarks'))],
+    _('[-U] [--nobookmarks] SOURCE [DEST]'),
     norepo=True)
-def share(ui, source, dest=None, noupdate=False, bookmarks=False):
+def share(ui, source, dest=None, noupdate=False, nobookmarks=False):
     """create a new shared repository
 
     Initialize a new repository and working directory that shares its
-    history (and optionally bookmarks) with another repository.
+    history (and bookmarks by default) with another repository.
 
     .. note::
 
@@ -37,7 +37,7 @@  def share(ui, source, dest=None, noupdat
        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, not nobookmarks)
 
 @command('unshare', [], '')
 def unshare(ui, repo):
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 @@  check that a change does not propagate
 
 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
@@ -212,7 +212,7 @@  test pushing bookmarks works
 
 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