Show More
@@ -123,7 +123,7 b' def clone(orig, ui, source, *args, **opt' | |||||
123 | def extsetup(ui): |
|
123 | def extsetup(ui): | |
124 | extensions.wrapfunction(bookmarks.bmstore, 'getbkfile', getbkfile) |
|
124 | extensions.wrapfunction(bookmarks.bmstore, 'getbkfile', getbkfile) | |
125 | extensions.wrapfunction(bookmarks.bmstore, 'recordchange', recordchange) |
|
125 | extensions.wrapfunction(bookmarks.bmstore, 'recordchange', recordchange) | |
126 | extensions.wrapfunction(bookmarks.bmstore, 'write', write) |
|
126 | extensions.wrapfunction(bookmarks.bmstore, '_writerepo', writerepo) | |
127 | extensions.wrapcommand(commands.table, 'clone', clone) |
|
127 | extensions.wrapcommand(commands.table, 'clone', clone) | |
128 |
|
128 | |||
129 | def _hassharedbookmarks(repo): |
|
129 | def _hassharedbookmarks(repo): | |
@@ -166,10 +166,11 b' def recordchange(orig, self, tr):' | |||||
166 | category = 'share-bookmarks' |
|
166 | category = 'share-bookmarks' | |
167 | tr.addpostclose(category, lambda tr: self._writerepo(srcrepo)) |
|
167 | tr.addpostclose(category, lambda tr: self._writerepo(srcrepo)) | |
168 |
|
168 | |||
169 | def write(orig, self): |
|
169 | def writerepo(orig, self, repo): | |
170 | # First write local bookmarks file in case we ever unshare |
|
170 | # First write local bookmarks file in case we ever unshare | |
171 | orig(self) |
|
171 | orig(self, repo) | |
|
172 | ||||
172 | if _hassharedbookmarks(self._repo): |
|
173 | if _hassharedbookmarks(self._repo): | |
173 | srcrepo = _getsrcrepo(self._repo) |
|
174 | srcrepo = _getsrcrepo(self._repo) | |
174 | if srcrepo is not None: |
|
175 | if srcrepo is not None: | |
175 |
self |
|
176 | orig(self, srcrepo) |
@@ -1174,3 +1174,42 b' Try again but with a corrupted shelve st' | |||||
1174 | rebase aborted |
|
1174 | rebase aborted | |
1175 | $ hg up -C . |
|
1175 | $ hg up -C . | |
1176 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1176 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
1177 | ||||
|
1178 | $ cd .. | |||
|
1179 | ||||
|
1180 | Keep active bookmark while (un)shelving even on shared repo (issue4940) | |||
|
1181 | ----------------------------------------------------------------------- | |||
|
1182 | ||||
|
1183 | $ cat <<EOF >> $HGRCPATH | |||
|
1184 | > [extensions] | |||
|
1185 | > share = | |||
|
1186 | > EOF | |||
|
1187 | ||||
|
1188 | $ hg bookmarks -R repo | |||
|
1189 | test 4:33f7f61e6c5e | |||
|
1190 | $ hg share -B repo share | |||
|
1191 | updating working directory | |||
|
1192 | 6 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
1193 | $ cd share | |||
|
1194 | ||||
|
1195 | $ hg bookmarks | |||
|
1196 | test 4:33f7f61e6c5e | |||
|
1197 | $ hg bookmarks foo | |||
|
1198 | $ hg bookmarks | |||
|
1199 | * foo 5:703117a2acfb | |||
|
1200 | test 4:33f7f61e6c5e | |||
|
1201 | $ echo x >> x | |||
|
1202 | $ hg shelve | |||
|
1203 | shelved as foo | |||
|
1204 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
1205 | $ hg bookmarks | |||
|
1206 | * foo 5:703117a2acfb | |||
|
1207 | test 4:33f7f61e6c5e | |||
|
1208 | ||||
|
1209 | $ hg unshelve | |||
|
1210 | unshelving change 'foo' | |||
|
1211 | $ hg bookmarks | |||
|
1212 | * foo 5:703117a2acfb | |||
|
1213 | test 4:33f7f61e6c5e | |||
|
1214 | ||||
|
1215 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now