mercurial/localrepo.py
changeset 33706 01a1c4e66816
parent 33703 da3087b8f4a2
child 33737 02a745c20121
--- a/mercurial/localrepo.py	Sun Aug 06 17:47:41 2017 -0700
+++ b/mercurial/localrepo.py	Wed Jul 19 13:34:06 2017 -0700
@@ -1461,6 +1461,13 @@
             # dirstate is invalidated separately in invalidatedirstate()
             if k == 'dirstate':
                 continue
+            if (k == 'changelog' and
+                self.currenttransaction() and
+                self.changelog._delayed):
+                # The changelog object may store unwritten revisions. We don't
+                # want to lose them.
+                # TODO: Solve the problem instead of working around it.
+                continue
 
             if clearfilecache:
                 del self._filecache[k]