[PATCH 13 of 16] ancestor: add a way to test whether a missing ancestor object has bases

Siddharth Agarwal sid0 at fb.com
Sun Nov 16 03:17:15 CST 2014


# HG changeset patch
# User Siddharth Agarwal <sid0 at fb.com>
# Date 1416127169 28800
#      Sun Nov 16 00:39:29 2014 -0800
# Node ID 124d0f634a52d89c5ca2780a9c052ae785b32f7c
# Parent  e189800f0eb87e338977a384bbd54399b6635035
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.

diff --git a/mercurial/ancestor.py b/mercurial/ancestor.py
--- a/mercurial/ancestor.py
+++ b/mercurial/ancestor.py
@@ -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
 


More information about the Mercurial-devel mailing list