# HG changeset patch # User Dirkjan Ochtman # Date 1243497281 -7200 # Node ID cfdd4ec5230af751151ce047d0397a00abddeec7 # Parent 27e9fea5d114e9efdbd0b3b2f0ac0880f0228245 Merge fetch_history_at_paths() and revisions() in svn wrappers. diff --git a/hgsubversion/svnwrap/svn_ctypes_wrapper.py b/hgsubversion/svnwrap/svn_ctypes_wrapper.py --- a/hgsubversion/svnwrap/svn_ctypes_wrapper.py +++ b/hgsubversion/svnwrap/svn_ctypes_wrapper.py @@ -78,7 +78,7 @@ class SubversionRepo(object): """ raise NotImplementedError - def revisions(self, start=None, chunk_size=1000): + def revisions(self, paths=None, start=None, stop=None, chunk_size=1000): """Load the history of this repo. This is LAZY. It returns a generator, and fetches a small number @@ -95,11 +95,6 @@ class SubversionRepo(object): # kind of tough cookies, sadly. raise NotImplementedError - - def fetch_history_at_paths(self, paths, start=None, stop=None, - chunk_size=1000): - raise NotImplementedError - def get_replay(self, revision, editor, oldest_rev_i_have=0): raise NotImplementedError diff --git a/hgsubversion/svnwrap/svn_swig_wrapper.py b/hgsubversion/svnwrap/svn_swig_wrapper.py --- a/hgsubversion/svnwrap/svn_swig_wrapper.py +++ b/hgsubversion/svnwrap/svn_swig_wrapper.py @@ -263,7 +263,7 @@ class SubversionRepo(object): head=self.HEAD for b in branches: b_path = 'branches/%s' %b - hist_gen = self.fetch_history_at_paths([b_path], stop=head) + hist_gen = self.revisions([b_path], stop=head) hist = hist_gen.next() source, source_rev = self._get_copy_source(b_path, cached_head=head) # This if statement guards against projects that have non-ancestral @@ -313,7 +313,7 @@ class SubversionRepo(object): """ if not cached_head: cached_head = self.HEAD - hist_gen = self.fetch_history_at_paths([path], stop=cached_head) + hist_gen = self.revisions([path], stop=cached_head) hist = hist_gen.next() if hist.paths[path].copyfrom_path is None: return None, None @@ -349,7 +349,8 @@ class SubversionRepo(object): folders, props, junk = r return folders - def revisions(self, start=None, stop=None, chunk_size=_chunk_size): + def revisions(self, paths=None, start=None, stop=None, + chunk_size=_chunk_size): """Load the history of this repo. This is LAZY. It returns a generator, and fetches a small number @@ -358,13 +359,8 @@ class SubversionRepo(object): The reason this is lazy is so that you can use the same repo object to perform RA calls to get deltas. """ - return self.fetch_history_at_paths([''], start=start, stop=stop, - chunk_size=chunk_size) - - def fetch_history_at_paths(self, paths, start=None, stop=None, - chunk_size=_chunk_size): - '''TODO: This method should be merged with self.revisions() as - they are now functionally equivalent.''' + if paths is None: + paths = [''] if not start: start = self.START if not stop: