Mercurial > public > mercurial-scm > hg
comparison mercurial/hg.py @ 23614:cd79fb4d75fd
share: add option to share bookmarks
This patch adds the -B/--bookmarks option to the share command added by the
share extension. All it does for now is create a marker, 'bookmarks.shared',
that will be used by future code to implement the sharing functionality.
author | Ryan McElroy <rmcelroy@fb.com> |
---|---|
date | Sat, 13 Dec 2014 11:32:46 -0800 |
parents | 68c434799559 |
children | 7cc77030c557 |
comparison
equal
deleted
inserted
replaced
23613:7b8ff3fd11d3 | 23614:cd79fb4d75fd |
---|---|
156 path = util.url(source).path | 156 path = util.url(source).path |
157 if not path: | 157 if not path: |
158 return '' | 158 return '' |
159 return os.path.basename(os.path.normpath(path)) | 159 return os.path.basename(os.path.normpath(path)) |
160 | 160 |
161 def share(ui, source, dest=None, update=True): | 161 def share(ui, source, dest=None, update=True, bookmarks=True): |
162 '''create a shared repository''' | 162 '''create a shared repository''' |
163 | 163 |
164 if not islocal(source): | 164 if not islocal(source): |
165 raise util.Abort(_('can only share local repositories')) | 165 raise util.Abort(_('can only share local repositories')) |
166 | 166 |
222 uprev = r.lookup(test) | 222 uprev = r.lookup(test) |
223 break | 223 break |
224 except error.RepoLookupError: | 224 except error.RepoLookupError: |
225 continue | 225 continue |
226 _update(r, uprev) | 226 _update(r, uprev) |
227 | |
228 if bookmarks: | |
229 r.opener('bookmarks.shared', 'w').close() | |
227 | 230 |
228 def copystore(ui, srcrepo, destpath): | 231 def copystore(ui, srcrepo, destpath): |
229 '''copy files from store of srcrepo in destpath | 232 '''copy files from store of srcrepo in destpath |
230 | 233 |
231 returns destlock | 234 returns destlock |