Patchwork share: make bookmark sharing default

login
register
mail settings
Submitter Ryan McElroy
Date Dec. 2, 2014, 8:48 p.m.
Message ID <5058edfef772ef7f2b04.1417553284@devbig105.prn2.facebook.com>
Download mbox | patch
Permalink /patch/6961/
State Changes Requested
Headers show

Comments

Ryan McElroy - Dec. 2, 2014, 8:48 p.m.
# HG changeset patch
# User Ryan McElroy <rmcelroy@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.
Pierre-Yves David - Dec. 2, 2014, 9:17 p.m.
On 12/02/2014 12:48 PM, Ryan McElroy wrote:
> # HG changeset patch
> # User Ryan McElroy <rmcelroy@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.

I talked with Ryan in real life. He will resent a V2 of the initial 
series that shares bookmarks in all case.

Adding Matt in CC so he can complains loudly if he disagree.

Patch

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