##// END OF EJS Templates
rebase: perform update through the 'update' command...
Pierre-Yves David -
r28118:0e3835c7 default
parent child Browse files
Show More
@@ -16,7 +16,7 b' https://mercurial-scm.org/wiki/RebaseExt'
16
16
17 from mercurial import hg, util, repair, merge, cmdutil, commands, bookmarks
17 from mercurial import hg, util, repair, merge, cmdutil, commands, bookmarks
18 from mercurial import extensions, patch, scmutil, phases, obsolete, error
18 from mercurial import extensions, patch, scmutil, phases, obsolete, error
19 from mercurial import copies, repoview, revset
19 from mercurial import copies, destutil, repoview, revset
20 from mercurial.commands import templateopts
20 from mercurial.commands import templateopts
21 from mercurial.node import nullrev, nullid, hex, short
21 from mercurial.node import nullrev, nullid, hex, short
22 from mercurial.lock import release
22 from mercurial.lock import release
@@ -1145,7 +1145,6 b' def pullrebase(orig, ui, repo, *args, **'
1145 ui.debug('--update and --rebase are not compatible, ignoring '
1145 ui.debug('--update and --rebase are not compatible, ignoring '
1146 'the update flag\n')
1146 'the update flag\n')
1147
1147
1148 movemarkfrom = repo['.'].node()
1149 revsprepull = len(repo)
1148 revsprepull = len(repo)
1150 origpostincoming = commands.postincoming
1149 origpostincoming = commands.postincoming
1151 def _dummy(*args, **kwargs):
1150 def _dummy(*args, **kwargs):
@@ -1166,15 +1165,11 b' def pullrebase(orig, ui, repo, *args, **'
1166 if 'source' in opts:
1165 if 'source' in opts:
1167 del opts['source']
1166 del opts['source']
1168 if rebase(ui, repo, **opts) == _nothingtorebase():
1167 if rebase(ui, repo, **opts) == _nothingtorebase():
1169 branch = repo[None].branch()
1168 rev, _a, _b = destutil.destupdate(repo)
1170 dest = repo[branch].rev()
1169 if rev != repo['.'].rev(): # we could update
1171 if dest != repo['.'].rev():
1170 # not passing argument to get the bare update behavior
1172 # there was nothing to rebase we force an update
1171 # with warning and trumpets
1173 hg.update(repo, dest)
1172 commands.update(ui, repo)
1174 if bookmarks.update(repo, [movemarkfrom],
1175 repo['.'].node()):
1176 ui.status(_("updating bookmark %s\n")
1177 % repo._activebookmark)
1178 finally:
1173 finally:
1179 release(lock, wlock)
1174 release(lock, wlock)
1180 else:
1175 else:
@@ -266,3 +266,46 b' pull --rebase only update if there is no'
266 |
266 |
267 o 0: 'C1'
267 o 0: 'C1'
268
268
269
270 pull --rebase update (no rebase) use proper update:
271
272 - warn about other head.
273
274 $ cd ../a
275 $ echo R6 > R6
276 $ hg ci -Am R6
277 adding R6
278 $ cd ../c
279 $ hg up 'desc(R5)'
280 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
281 $ hg pull --rebase
282 pulling from $TESTTMP/a (glob)
283 searching for changes
284 adding changesets
285 adding manifests
286 adding file changes
287 added 1 changesets with 1 changes to 1 files (+1 heads)
288 nothing to rebase - working directory parent is already an ancestor of destination 65bc164c1d9b
289 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
290 1 other heads for branch "default"
291 $ hg tglog
292 @ 9: 'R6'
293 |
294 | o 8: 'L2'
295 | |
296 | o 7: 'L1'
297 |/
298 o 6: 'R5'
299 |
300 o 5: 'R4'
301 |
302 o 4: 'R3'
303 |
304 o 3: 'R2'
305 |
306 o 2: 'R1'
307 |
308 o 1: 'C2'
309 |
310 o 0: 'C1'
311
General Comments 0
You need to be logged in to leave comments. Login now