13 cmdtable = {} |
13 cmdtable = {} |
14 command = cmdutil.command(cmdtable) |
14 command = cmdutil.command(cmdtable) |
15 testedwith = 'internal' |
15 testedwith = 'internal' |
16 |
16 |
17 @command('share', |
17 @command('share', |
18 [('U', 'noupdate', None, _('do not create a working copy'))], |
18 [('U', 'noupdate', None, _('do not create a working copy')), |
19 _('[-U] SOURCE [DEST]'), |
19 ('B', 'bookmarks', None, _('also share bookmarks'))], |
|
20 _('[-U] [-B] SOURCE [DEST]'), |
20 norepo=True) |
21 norepo=True) |
21 def share(ui, source, dest=None, noupdate=False): |
22 def share(ui, source, dest=None, noupdate=False, bookmarks=False): |
22 """create a new shared repository |
23 """create a new shared repository |
23 |
24 |
24 Initialize a new repository and working directory that shares its |
25 Initialize a new repository and working directory that shares its |
25 history with another repository. |
26 history (and optionally bookmarks) with another repository. |
26 |
27 |
27 .. note:: |
28 .. note:: |
28 |
29 |
29 using rollback or extensions that destroy/modify history (mq, |
30 using rollback or extensions that destroy/modify history (mq, |
30 rebase, etc.) can cause considerable confusion with shared |
31 rebase, etc.) can cause considerable confusion with shared |
34 operations will fail with "abort: working directory has unknown |
35 operations will fail with "abort: working directory has unknown |
35 parent". The only known workaround is to use debugsetparents on |
36 parent". The only known workaround is to use debugsetparents on |
36 the broken clone to reset it to a changeset that still exists. |
37 the broken clone to reset it to a changeset that still exists. |
37 """ |
38 """ |
38 |
39 |
39 return hg.share(ui, source, dest, not noupdate) |
40 return hg.share(ui, source, dest, not noupdate, bookmarks) |
40 |
41 |
41 @command('unshare', [], '') |
42 @command('unshare', [], '') |
42 def unshare(ui, repo): |
43 def unshare(ui, repo): |
43 """convert a shared repository to a normal one |
44 """convert a shared repository to a normal one |
44 |
45 |