def is_changes_root(self): """Check whether this revisions root is the root of the changes in this svn revision. This is a requirement for revisions pushed with bzr-svn using file properties. """ return changes.changes_root(self.paths.keys()) == self.branch_path
def test_multiple_roots(self): self.assertEquals(None, changes_root([u"bla", u"blie"]))
def test_single(self): self.assertEquals(u"bla", changes_root([u"bla"]))
def test_simple_other(self): self.assertEquals(u"bla", changes_root([u"bla/blie", u"bla"]))
def test_siblings(self): self.assertEquals(u"bla", changes_root([u"bla/blie", u"bla/bloe", u"bla"]))
def test_empty(self): self.assertEquals(None, changes_root([]))
def find_roundtripped_root(revprops, path_changes): # Find the root path of the change bp = revprops.get(SVN_REVPROP_BZR_ROOT) if bp is not None: return bp.decode('utf-8') return changes.changes_root(path_changes.keys())