mercurial/context.py
changeset 35319 228916ca12b5
parent 35295 bea46aed1e1b
child 35321 2e1c32a9c97b
--- a/mercurial/context.py	Thu Dec 07 16:07:06 2017 -0800
+++ b/mercurial/context.py	Thu Dec 07 22:35:43 2017 -0800
@@ -2102,6 +2102,12 @@
     def isdirty(self, path):
         return path in self._cache
 
+    def isempty(self):
+        # We need to discard any keys that are actually clean before the empty
+        # commit check.
+        self._compact()
+        return len(self._cache) == 0
+
     def clean(self):
         self._cache = {}