changeset 23340:83225aff0265

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.
author Siddharth Agarwal <sid0@fb.com>
date Sun, 16 Nov 2014 00:39:29 -0800
parents 5c3a29be8fae
children bcc3012f8477
files mercurial/ancestor.py
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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