# HG changeset patch # User Dan Villiom Podlaski Christiansen # Date 1241177157 -7200 # Node ID e6853c7fa3af3d7776fae6c4f4e8b9f006e54f74 # Parent 97360cb777a835c596cb6097fea6b6e713da0555 hg_delta_editor: fix _split_tag_path to actually work as intended. I don't remember why I wrote this function, but it might be useful. This changeset passes all tests, although I couldn't remember how to run the comprehensive test suite. diff --git a/hg_delta_editor.py b/hg_delta_editor.py --- a/hg_delta_editor.py +++ b/hg_delta_editor.py @@ -399,16 +399,22 @@ class HgChangeReceiver(delta.Editor): Otherwise, returns False. """ - return self._split_tag_path(path)[-1] or False + return self._split_tag_path(path)[1] or False def _split_tag_path(self, path): - r = (None, None, None) + """Figure out which tag inside our repo this path represents, and + also figure out which path inside that tag it is. + + Returns a tuple of (path within tag, tag name, server-side tag + path). + """ path = self._normalize_path(path) for tags_path in self.tag_locations: if path and (path.startswith(tags_path) and len(path) > len('%s/' % tags_path)): - return path[len(tags_path)+1:] - return False + tag, _, subpath = path[len(tags_path)+1:].partition('/') + return (subpath, tag, '%s/%s' % (tags_path, tag)) + return (None, None, None) def get_parent_svn_branch_and_rev(self, number, branch): number -= 1