mercurial/phases.py
changeset 23361 936b0ff34346
parent 22940 e803186296ab
child 23631 b8260abfeb7d
--- a/mercurial/phases.py	Sun Sep 28 21:27:48 2014 -0700
+++ b/mercurial/phases.py	Fri Oct 17 22:23:06 2014 -0700
@@ -100,6 +100,7 @@
 
 """
 
+import os
 import errno
 from node import nullid, nullrev, bin, hex, short
 from i18n import _
@@ -124,7 +125,15 @@
     dirty = False
     roots = [set() for i in allphases]
     try:
-        f = repo.sopener('phaseroots')
+        f = None
+        if 'HG_PENDING' in os.environ:
+            try:
+                f = repo.svfs('phaseroots.pending')
+            except IOError, inst:
+                if inst.errno != errno.ENOENT:
+                    raise
+        if f is None:
+            f = repo.sopener('phaseroots')
         try:
             for line in f:
                 phase, nh = line.split()