From 86a86fc074bd3eb8a235a5969e97eb81acca9e03 Mon Sep 17 00:00:00 2001 From: Elijah Newren Date: Sat, 21 Mar 2009 12:24:17 -0600 Subject: [PATCH] filter-repo: remove the id_offset Filtering input from multiple repositories can still be done; however, to avoid overloading of mark numbers, one should pass --export-marks= to the first git fast-export and pass --import-marks= to the second. Signed-off-by: Elijah Newren --- git-filter-repo | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/git-filter-repo b/git-filter-repo index 833361b..c4d0b66 100755 --- a/git-filter-repo +++ b/git-filter-repo @@ -255,8 +255,6 @@ class FastExportFilter(object): self.output = sys.stdout self.nextline = '' - self.id_offset = 0 - def _advance_nextline(self): self.nextline = self.input.readline() @@ -264,7 +262,7 @@ class FastExportFilter(object): mark = None matches = re.match('mark :(\d+)\n$', self.nextline) if matches: - mark = int(matches.group(1))+self.id_offset + mark = int(matches.group(1)) self._advance_nextline() return mark @@ -272,7 +270,7 @@ class FastExportFilter(object): baseref = None matches = re.match('%s :(\d+)\n' % refname, self.nextline) if matches: - baseref = ids.translate( int(matches.group(1))+self.id_offset ) + baseref = ids.translate( int(matches.group(1)) ) self._advance_nextline() return baseref @@ -281,7 +279,7 @@ class FastExportFilter(object): if self.nextline.startswith('M '): (mode, idnum, path) = \ re.match('M (\d+) :(\d+) (.*)\n$', self.nextline).groups() - idnum = ids.translate( int(idnum)+self.id_offset ) + idnum = ids.translate( int(idnum) ) if idnum is not None: if path.startswith('"'): path = unquote(path) @@ -458,7 +456,6 @@ class FastExportFilter(object): # Setup some vars global current_stream_number - self.id_offset = ids.count current_stream_number += 1 # Run over the input and do the filtering