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