From a039dc5565b256859faf5b302ccb79a5f3ef9846 Mon Sep 17 00:00:00 2001 From: mhagger Date: Wed, 1 Feb 2012 09:00:45 +0000 Subject: [PATCH] Rewrite CVSDirectory.get_path_components() without recursion. git-svn-id: http://cvs2svn.tigris.org/svn/cvs2svn/trunk@5376 be7e6eca-30d4-0310-a8e5-ac0d63af7087 --- cvs2svn_lib/cvs_path.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/cvs2svn_lib/cvs_path.py b/cvs2svn_lib/cvs_path.py index 083c8c28..318eafe6 100644 --- a/cvs2svn_lib/cvs_path.py +++ b/cvs2svn_lib/cvs_path.py @@ -235,12 +235,14 @@ class CVSDirectory(CVSPath): self.empty_subdirectory_ids = [] def get_path_components(self, rcs=False): - if self.parent_directory is None: - return [] - else: - components = self.parent_directory.get_path_components(rcs=rcs) - components.append(self.rcs_basename) - return components + components = [] + p = self + while p.parent_directory is not None: + components.append(p.rcs_basename) + p = p.parent_directory + + components.reverse() + return components def __getstate__(self): return ( -- 2.11.4.GIT