D24: rebase: remove revprecursor and revpruned states (BC)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

D24: rebase: remove revprecursor and revpruned states (BC)

dsp (David Soria Parra)
quark updated this revision to Diff 773.
This revision is now accepted and ready to land.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D24?vs=158&id=773

REVISION DETAIL
  https://phab.mercurial-scm.org/D24

AFFECTED FILES
  hgext/rebase.py
  tests/test-rebase-obsolete.t

CHANGE DETAILS

diff --git a/tests/test-rebase-obsolete.t b/tests/test-rebase-obsolete.t
--- a/tests/test-rebase-obsolete.t
+++ b/tests/test-rebase-obsolete.t
@@ -1223,10 +1223,10 @@
   2:1e9a3c00cbe9 b
   $ hg rebase -r 2 -d 3 --config experimental.evolution.track-operation=1
   note: not rebasing 2:1e9a3c00cbe9 "b" (mybook), already in destination as 3:be1832deae9a "b"
-Check that working directory was updated to rev 3 although rev 2 was skipped
+Check that working directory was not updated to rev 3 because rev 2 was skipped
 during the rebase operation
   $ hg log -r .
-  3:be1832deae9a b
+  2:1e9a3c00cbe9 b
 
 Check that bookmark was not moved to rev 3 if rev 2 was skipped during the
 rebase operation. This makes sense because if rev 2 has a successor, the
diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -62,10 +62,10 @@
 revtodo = -1
 nullmerge = -2
 revignored = -3
-# successor in rebase destination
-revprecursor = -4
-# plain prune (no successor)
-revpruned = -5
+
+# legacy revstates no longer needed in current code
+# -4: revprecursor, -5: revpruned
+legacystates = {'-4', '-5'}
 
 cmdtable = {}
 command = registrar.command(cmdtable)
@@ -231,8 +231,9 @@
                     activebookmark = l
                 else:
                     oldrev, newrev = l.split(':')
-                    if newrev in (str(nullmerge), str(revignored),
-                                  str(revprecursor), str(revpruned)):
+                    if newrev in legacystates:
+                        continue
+                    if newrev in (str(nullmerge), str(revignored)):
                         state[repo[oldrev].rev()] = int(newrev)
                     elif newrev == nullid:
                         state[repo[oldrev].rev()] = revtodo
@@ -308,9 +309,6 @@
             return abort(self.repo, self.originalwd, self.dest,
                          self.state, activebookmark=self.activebookmark)
 
-        obsrevs = (r for r, st in self.state.items() if st == revprecursor)
-        self._handleskippingobsolete(self.state.keys(), obsrevs, self.dest)
-
     def _preparenewrebase(self, dest, rebaseset):
         if dest is None:
             return _nothingtorebase()
@@ -445,10 +443,6 @@
                 ui.debug('ignoring null merge rebase of %s\n' % rev)
             elif self.state[rev] == revignored:
                 ui.status(_('not rebasing ignored %s\n') % desc)
-            elif self.state[rev] == revprecursor:
-                pass
-            elif self.state[rev] == revpruned:
-                pass
             else:
                 ui.status(_('already rebased %s as %s\n') %
                           (desc, repo[self.state[rev]]))
@@ -499,9 +493,7 @@
         # restore original working directory
         # (we do this before stripping)
         newwd = self.state.get(self.originalwd, self.originalwd)
-        if newwd == revprecursor:
-            newwd = self.obsoletenotrebased[self.originalwd]
-        elif newwd < 0:
+        if newwd < 0:
             # original directory is a parent of rebase set root or ignored
             newwd = self.originalwd
         if newwd not in [c.rev() for c in repo[None].parents()]:
@@ -1386,14 +1378,14 @@
         succ = obsoletenotrebased[r]
         if succ is None:
             msg = _('note: not rebasing %s, it has no successor\n') % desc
-            state[r] = revpruned
+            del state[r]
         else:
             destctx = unfi[succ]
             destdesc = '%d:%s "%s"' % (destctx.rev(), destctx,
                                        destctx.description().split('\n', 1)[0])
             msg = (_('note: not rebasing %s, already in destination as %s\n')
                    % (desc, destdesc))
-            state[r] = revprecursor
+            del state[r]
         repo.ui.status(msg)
     return originalwd, dest.rev(), state
 



To: quark, durin42, #hg-reviewers
Cc: durin42, mercurial-devel
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

D24: rebase: remove revprecursor and revpruned states (BC)

dsp (David Soria Parra)
quark updated this revision to Diff 833.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D24?vs=773&id=833

REVISION DETAIL
  https://phab.mercurial-scm.org/D24

AFFECTED FILES
  hgext/rebase.py
  tests/test-rebase-obsolete.t

CHANGE DETAILS

diff --git a/tests/test-rebase-obsolete.t b/tests/test-rebase-obsolete.t
--- a/tests/test-rebase-obsolete.t
+++ b/tests/test-rebase-obsolete.t
@@ -1190,10 +1190,10 @@
   2:1e9a3c00cbe9 b (no-eol)
   $ hg rebase -r 2 -d 3 --config experimental.evolution.track-operation=1
   note: not rebasing 2:1e9a3c00cbe9 "b" (mybook), already in destination as 3:be1832deae9a "b"
-Check that working directory was updated to rev 3 although rev 2 was skipped
+Check that working directory was not updated to rev 3 because rev 2 was skipped
 during the rebase operation
   $ hg log -r .
-  3:be1832deae9a b (no-eol)
+  2:1e9a3c00cbe9 b (no-eol)
 
 Check that bookmark was not moved to rev 3 if rev 2 was skipped during the
 rebase operation. This makes sense because if rev 2 has a successor, the
diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -62,10 +62,10 @@
 revtodo = -1
 nullmerge = -2
 revignored = -3
-# successor in rebase destination
-revprecursor = -4
-# plain prune (no successor)
-revpruned = -5
+
+# legacy revstates no longer needed in current code
+# -4: revprecursor, -5: revpruned
+legacystates = {'-4', '-5'}
 
 cmdtable = {}
 command = registrar.command(cmdtable)
@@ -231,8 +231,9 @@
                     activebookmark = l
                 else:
                     oldrev, newrev = l.split(':')
-                    if newrev in (str(nullmerge), str(revignored),
-                                  str(revprecursor), str(revpruned)):
+                    if newrev in legacystates:
+                        continue
+                    if newrev in (str(nullmerge), str(revignored)):
                         state[repo[oldrev].rev()] = int(newrev)
                     elif newrev == nullid:
                         state[repo[oldrev].rev()] = revtodo
@@ -308,9 +309,6 @@
             return abort(self.repo, self.originalwd, self.dest,
                          self.state, activebookmark=self.activebookmark)
 
-        obsrevs = (r for r, st in self.state.items() if st == revprecursor)
-        self._handleskippingobsolete(self.state.keys(), obsrevs, self.dest)
-
     def _preparenewrebase(self, dest, rebaseset):
         if dest is None:
             return _nothingtorebase()
@@ -445,10 +443,6 @@
                 ui.debug('ignoring null merge rebase of %s\n' % rev)
             elif self.state[rev] == revignored:
                 ui.status(_('not rebasing ignored %s\n') % desc)
-            elif self.state[rev] == revprecursor:
-                pass
-            elif self.state[rev] == revpruned:
-                pass
             else:
                 ui.status(_('already rebased %s as %s\n') %
                           (desc, repo[self.state[rev]]))
@@ -499,9 +493,7 @@
         # restore original working directory
         # (we do this before stripping)
         newwd = self.state.get(self.originalwd, self.originalwd)
-        if newwd == revprecursor:
-            newwd = self.obsoletenotrebased[self.originalwd]
-        elif newwd < 0:
+        if newwd < 0:
             # original directory is a parent of rebase set root or ignored
             newwd = self.originalwd
         if newwd not in [c.rev() for c in repo[None].parents()]:
@@ -1429,14 +1421,14 @@
         succ = obsoletenotrebased[r]
         if succ is None:
             msg = _('note: not rebasing %s, it has no successor\n') % desc
-            state[r] = revpruned
+            del state[r]
         else:
             destctx = unfi[succ]
             destdesc = '%d:%s "%s"' % (destctx.rev(), destctx,
                                        destctx.description().split('\n', 1)[0])
             msg = (_('note: not rebasing %s, already in destination as %s\n')
                    % (desc, destdesc))
-            state[r] = revprecursor
+            del state[r]
         repo.ui.status(msg)
     return originalwd, dest.rev(), state
 



To: quark, durin42, #hg-reviewers
Cc: durin42, mercurial-devel
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

D24: rebase: remove revprecursor and revpruned states (BC)

dsp (David Soria Parra)
In reply to this post by dsp (David Soria Parra)
quark updated this revision to Diff 895.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D24?vs=833&id=895

REVISION DETAIL
  https://phab.mercurial-scm.org/D24

AFFECTED FILES
  hgext/rebase.py
  tests/test-rebase-obsolete.t

CHANGE DETAILS

diff --git a/tests/test-rebase-obsolete.t b/tests/test-rebase-obsolete.t
--- a/tests/test-rebase-obsolete.t
+++ b/tests/test-rebase-obsolete.t
@@ -1263,10 +1263,10 @@
   2:1e9a3c00cbe9 b (no-eol)
   $ hg rebase -r 2 -d 3 --config experimental.stabilization.track-operation=1
   note: not rebasing 2:1e9a3c00cbe9 "b" (mybook), already in destination as 3:be1832deae9a "b"
-Check that working directory was updated to rev 3 although rev 2 was skipped
+Check that working directory was not updated to rev 3 because rev 2 was skipped
 during the rebase operation
   $ hg log -r .
-  3:be1832deae9a b (no-eol)
+  2:1e9a3c00cbe9 b (no-eol)
 
 Check that bookmark was not moved to rev 3 if rev 2 was skipped during the
 rebase operation. This makes sense because if rev 2 has a successor, the
diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -62,10 +62,10 @@
 revtodo = -1
 nullmerge = -2
 revignored = -3
-# successor in rebase destination
-revprecursor = -4
-# plain prune (no successor)
-revpruned = -5
+
+# legacy revstates no longer needed in current code
+# -4: revprecursor, -5: revpruned
+legacystates = {'-4', '-5'}
 
 cmdtable = {}
 command = registrar.command(cmdtable)
@@ -231,8 +231,9 @@
                     activebookmark = l
                 else:
                     oldrev, newrev = l.split(':')
-                    if newrev in (str(nullmerge), str(revignored),
-                                  str(revprecursor), str(revpruned)):
+                    if newrev in legacystates:
+                        continue
+                    if newrev in (str(nullmerge), str(revignored)):
                         state[repo[oldrev].rev()] = int(newrev)
                     elif newrev == nullid:
                         state[repo[oldrev].rev()] = revtodo
@@ -308,9 +309,6 @@
             return abort(self.repo, self.originalwd, self.dest,
                          self.state, activebookmark=self.activebookmark)
 
-        obsrevs = (r for r, st in self.state.items() if st == revprecursor)
-        self._handleskippingobsolete(self.state.keys(), obsrevs, self.dest)
-
     def _preparenewrebase(self, dest, rebaseset):
         if dest is None:
             return _nothingtorebase()
@@ -445,10 +443,6 @@
                 ui.debug('ignoring null merge rebase of %s\n' % rev)
             elif self.state[rev] == revignored:
                 ui.status(_('not rebasing ignored %s\n') % desc)
-            elif self.state[rev] == revprecursor:
-                pass
-            elif self.state[rev] == revpruned:
-                pass
             else:
                 ui.status(_('already rebased %s as %s\n') %
                           (desc, repo[self.state[rev]]))
@@ -499,9 +493,7 @@
         # restore original working directory
         # (we do this before stripping)
         newwd = self.state.get(self.originalwd, self.originalwd)
-        if newwd == revprecursor:
-            newwd = self.obsoletenotrebased[self.originalwd]
-        elif newwd < 0:
+        if newwd < 0:
             # original directory is a parent of rebase set root or ignored
             newwd = self.originalwd
         if newwd not in [c.rev() for c in repo[None].parents()]:
@@ -1438,14 +1430,14 @@
         succ = obsoletenotrebased[r]
         if succ is None:
             msg = _('note: not rebasing %s, it has no successor\n') % desc
-            state[r] = revpruned
+            del state[r]
         else:
             destctx = unfi[succ]
             destdesc = '%d:%s "%s"' % (destctx.rev(), destctx,
                                        destctx.description().split('\n', 1)[0])
             msg = (_('note: not rebasing %s, already in destination as %s\n')
                    % (desc, destdesc))
-            state[r] = revprecursor
+            del state[r]
         repo.ui.status(msg)
     return originalwd, dest.rev(), state
 



To: quark, durin42, #hg-reviewers
Cc: durin42, mercurial-devel
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

D24: rebase: remove revprecursor and revpruned states (BC)

dsp (David Soria Parra)
In reply to this post by dsp (David Soria Parra)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGd8d0ef5f5975: rebase: remove revprecursor and revpruned states (BC) (authored by quark).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D24?vs=895&id=976

REVISION DETAIL
  https://phab.mercurial-scm.org/D24

AFFECTED FILES
  hgext/rebase.py
  tests/test-rebase-obsolete.t

CHANGE DETAILS

diff --git a/tests/test-rebase-obsolete.t b/tests/test-rebase-obsolete.t
--- a/tests/test-rebase-obsolete.t
+++ b/tests/test-rebase-obsolete.t
@@ -1152,10 +1152,10 @@
   2:1e9a3c00cbe9 b (no-eol)
   $ hg rebase -r 2 -d 3 --config experimental.stabilization.track-operation=1
   note: not rebasing 2:1e9a3c00cbe9 "b" (mybook), already in destination as 3:be1832deae9a "b"
-Check that working directory was updated to rev 3 although rev 2 was skipped
+Check that working directory was not updated to rev 3 because rev 2 was skipped
 during the rebase operation
   $ hg log -r .
-  3:be1832deae9a b (no-eol)
+  2:1e9a3c00cbe9 b (no-eol)
 
 Check that bookmark was not moved to rev 3 if rev 2 was skipped during the
 rebase operation. This makes sense because if rev 2 has a successor, the
diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -62,10 +62,10 @@
 revtodo = -1
 nullmerge = -2
 revignored = -3
-# successor in rebase destination
-revprecursor = -4
-# plain prune (no successor)
-revpruned = -5
+
+# legacy revstates no longer needed in current code
+# -4: revprecursor, -5: revpruned
+legacystates = {'-4', '-5'}
 
 cmdtable = {}
 command = registrar.command(cmdtable)
@@ -231,8 +231,9 @@
                     activebookmark = l
                 else:
                     oldrev, newrev = l.split(':')
-                    if newrev in (str(nullmerge), str(revignored),
-                                  str(revprecursor), str(revpruned)):
+                    if newrev in legacystates:
+                        continue
+                    if newrev in (str(nullmerge), str(revignored)):
                         state[repo[oldrev].rev()] = int(newrev)
                     elif newrev == nullid:
                         state[repo[oldrev].rev()] = revtodo
@@ -308,9 +309,6 @@
             return abort(self.repo, self.originalwd, self.dest,
                          self.state, activebookmark=self.activebookmark)
 
-        obsrevs = (r for r, st in self.state.items() if st == revprecursor)
-        self._handleskippingobsolete(self.state.keys(), obsrevs, self.dest)
-
     def _preparenewrebase(self, dest, rebaseset):
         if dest is None:
             return _nothingtorebase()
@@ -445,10 +443,6 @@
                 ui.debug('ignoring null merge rebase of %s\n' % rev)
             elif self.state[rev] == revignored:
                 ui.status(_('not rebasing ignored %s\n') % desc)
-            elif self.state[rev] == revprecursor:
-                pass
-            elif self.state[rev] == revpruned:
-                pass
             else:
                 ui.status(_('already rebased %s as %s\n') %
                           (desc, repo[self.state[rev]]))
@@ -499,9 +493,7 @@
         # restore original working directory
         # (we do this before stripping)
         newwd = self.state.get(self.originalwd, self.originalwd)
-        if newwd == revprecursor:
-            newwd = self.obsoletenotrebased[self.originalwd]
-        elif newwd < 0:
+        if newwd < 0:
             # original directory is a parent of rebase set root or ignored
             newwd = self.originalwd
         if newwd not in [c.rev() for c in repo[None].parents()]:
@@ -1414,14 +1406,14 @@
         succ = obsoletenotrebased[r]
         if succ is None:
             msg = _('note: not rebasing %s, it has no successor\n') % desc
-            state[r] = revpruned
+            del state[r]
         else:
             destctx = unfi[succ]
             destdesc = '%d:%s "%s"' % (destctx.rev(), destctx,
                                        destctx.description().split('\n', 1)[0])
             msg = (_('note: not rebasing %s, already in destination as %s\n')
                    % (desc, destdesc))
-            state[r] = revprecursor
+            del state[r]
         repo.ui.status(msg)
     return originalwd, dest.rev(), state
 



To: quark, durin42, #hg-reviewers
Cc: durin42, mercurial-devel
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Loading...