[PATCH 1 of 2] phases: add union() to update the phase cache with the other

elson.wei at gmail.com elson.wei at gmail.com
Thu Mar 27 20:33:17 CDT 2014


# HG changeset patch
# User Wei, Elson <elson.wei at gmail.com>
# Date 1395970042 -28800
#      Fri Mar 28 09:27:22 2014 +0800
# Node ID 077d695569cc1c6012b3aa6fb742b9dac22b133d
# Parent  308344d80fe558ec060bcaaac4e83a321d838810
phases: add union() to update the phase cache with the other

diff --git a/mercurial/phases.py b/mercurial/phases.py
--- a/mercurial/phases.py
+++ b/mercurial/phases.py
@@ -159,6 +159,10 @@
         ph._phaserevs = self._phaserevs
         return ph
 
+    def union(self, phcache):
+        for (phase, nhs) in enumerate(phcache.phaseroots):
+            self.phaseroots[phase] |= nhs
+
     def replace(self, phcache):
         for a in 'phaseroots dirty opener _phaserevs'.split():
             setattr(self, a, getattr(phcache, a))


More information about the Mercurial-devel mailing list