ancestor: add a way to test whether a missing ancestor object has bases
authorSiddharth Agarwal <sid0@fb.com>
Sun, 16 Nov 2014 00:39:29 -0800
changeset 23340 83225aff0265
parent 23339 5c3a29be8fae
child 23341 bcc3012f8477
ancestor: add a way to test whether a missing ancestor object has bases This is pretty trivial so there's no unit test coverage for it. This will be used by setdiscovery.
mercurial/ancestor.py
--- a/mercurial/ancestor.py	Fri Nov 14 16:53:40 2014 -0800
+++ b/mercurial/ancestor.py	Sun Nov 16 00:39:29 2014 -0800
@@ -146,6 +146,10 @@
             self.bases.add(nullrev)
         self.pfunc = pfunc
 
+    def hasbases(self):
+        '''whether the common set has any non-trivial bases'''
+        return self.bases and self.bases != set([nullrev])
+
     def missingancestors(self, revs):
         '''return all the ancestors of revs that are not ancestors of self.bases