##// END OF EJS Templates
rebase: remove revprecursor and revpruned states (BC)...
Jun Wu -
r33842:d8d0ef5f default
parent child Browse files
Show More
@@ -62,10 +62,10 b' templateopts = cmdutil.templateopts'
62 revtodo = -1
62 revtodo = -1
63 nullmerge = -2
63 nullmerge = -2
64 revignored = -3
64 revignored = -3
65 # successor in rebase destination
65
66 revprecursor = -4
66 # legacy revstates no longer needed in current code
67 # plain prune (no successor)
67 # -4: revprecursor, -5: revpruned
68 revpruned = -5
68 legacystates = {'-4', '-5'}
69
69
70 cmdtable = {}
70 cmdtable = {}
71 command = registrar.command(cmdtable)
71 command = registrar.command(cmdtable)
@@ -231,8 +231,9 b' class rebaseruntime(object):'
231 activebookmark = l
231 activebookmark = l
232 else:
232 else:
233 oldrev, newrev = l.split(':')
233 oldrev, newrev = l.split(':')
234 if newrev in (str(nullmerge), str(revignored),
234 if newrev in legacystates:
235 str(revprecursor), str(revpruned)):
235 continue
236 if newrev in (str(nullmerge), str(revignored)):
236 state[repo[oldrev].rev()] = int(newrev)
237 state[repo[oldrev].rev()] = int(newrev)
237 elif newrev == nullid:
238 elif newrev == nullid:
238 state[repo[oldrev].rev()] = revtodo
239 state[repo[oldrev].rev()] = revtodo
@@ -308,9 +309,6 b' class rebaseruntime(object):'
308 return abort(self.repo, self.originalwd, self.dest,
309 return abort(self.repo, self.originalwd, self.dest,
309 self.state, activebookmark=self.activebookmark)
310 self.state, activebookmark=self.activebookmark)
310
311
311 obsrevs = (r for r, st in self.state.items() if st == revprecursor)
312 self._handleskippingobsolete(self.state.keys(), obsrevs, self.dest)
313
314 def _preparenewrebase(self, dest, rebaseset):
312 def _preparenewrebase(self, dest, rebaseset):
315 if dest is None:
313 if dest is None:
316 return _nothingtorebase()
314 return _nothingtorebase()
@@ -445,10 +443,6 b' class rebaseruntime(object):'
445 ui.debug('ignoring null merge rebase of %s\n' % rev)
443 ui.debug('ignoring null merge rebase of %s\n' % rev)
446 elif self.state[rev] == revignored:
444 elif self.state[rev] == revignored:
447 ui.status(_('not rebasing ignored %s\n') % desc)
445 ui.status(_('not rebasing ignored %s\n') % desc)
448 elif self.state[rev] == revprecursor:
449 pass
450 elif self.state[rev] == revpruned:
451 pass
452 else:
446 else:
453 ui.status(_('already rebased %s as %s\n') %
447 ui.status(_('already rebased %s as %s\n') %
454 (desc, repo[self.state[rev]]))
448 (desc, repo[self.state[rev]]))
@@ -499,9 +493,7 b' class rebaseruntime(object):'
499 # restore original working directory
493 # restore original working directory
500 # (we do this before stripping)
494 # (we do this before stripping)
501 newwd = self.state.get(self.originalwd, self.originalwd)
495 newwd = self.state.get(self.originalwd, self.originalwd)
502 if newwd == revprecursor:
496 if newwd < 0:
503 newwd = self.obsoletenotrebased[self.originalwd]
504 elif newwd < 0:
505 # original directory is a parent of rebase set root or ignored
497 # original directory is a parent of rebase set root or ignored
506 newwd = self.originalwd
498 newwd = self.originalwd
507 if newwd not in [c.rev() for c in repo[None].parents()]:
499 if newwd not in [c.rev() for c in repo[None].parents()]:
@@ -1414,14 +1406,14 b' def buildstate(repo, dest, rebaseset, co'
1414 succ = obsoletenotrebased[r]
1406 succ = obsoletenotrebased[r]
1415 if succ is None:
1407 if succ is None:
1416 msg = _('note: not rebasing %s, it has no successor\n') % desc
1408 msg = _('note: not rebasing %s, it has no successor\n') % desc
1417 state[r] = revpruned
1409 del state[r]
1418 else:
1410 else:
1419 destctx = unfi[succ]
1411 destctx = unfi[succ]
1420 destdesc = '%d:%s "%s"' % (destctx.rev(), destctx,
1412 destdesc = '%d:%s "%s"' % (destctx.rev(), destctx,
1421 destctx.description().split('\n', 1)[0])
1413 destctx.description().split('\n', 1)[0])
1422 msg = (_('note: not rebasing %s, already in destination as %s\n')
1414 msg = (_('note: not rebasing %s, already in destination as %s\n')
1423 % (desc, destdesc))
1415 % (desc, destdesc))
1424 state[r] = revprecursor
1416 del state[r]
1425 repo.ui.status(msg)
1417 repo.ui.status(msg)
1426 return originalwd, dest.rev(), state
1418 return originalwd, dest.rev(), state
1427
1419
@@ -1152,10 +1152,10 b' equivalents in destination'
1152 2:1e9a3c00cbe9 b (no-eol)
1152 2:1e9a3c00cbe9 b (no-eol)
1153 $ hg rebase -r 2 -d 3 --config experimental.stabilization.track-operation=1
1153 $ hg rebase -r 2 -d 3 --config experimental.stabilization.track-operation=1
1154 note: not rebasing 2:1e9a3c00cbe9 "b" (mybook), already in destination as 3:be1832deae9a "b"
1154 note: not rebasing 2:1e9a3c00cbe9 "b" (mybook), already in destination as 3:be1832deae9a "b"
1155 Check that working directory was updated to rev 3 although rev 2 was skipped
1155 Check that working directory was not updated to rev 3 because rev 2 was skipped
1156 during the rebase operation
1156 during the rebase operation
1157 $ hg log -r .
1157 $ hg log -r .
1158 3:be1832deae9a b (no-eol)
1158 2:1e9a3c00cbe9 b (no-eol)
1159
1159
1160 Check that bookmark was not moved to rev 3 if rev 2 was skipped during the
1160 Check that bookmark was not moved to rev 3 if rev 2 was skipped during the
1161 rebase operation. This makes sense because if rev 2 has a successor, the
1161 rebase operation. This makes sense because if rev 2 has a successor, the
General Comments 0
You need to be logged in to leave comments. Login now