Mercurial > hg
diff hgext/convert/convcmd.py @ 5934:e495f3f35b2d
convert: hg.clonebranches must pull missing parents (issue941)
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Sat, 26 Jan 2008 19:55:04 +0100 |
parents | badbefa55972 |
children | 0162c6cc045e 37cc79a5727a |
line wrap: on
line diff
--- a/hgext/convert/convcmd.py Tue Jan 22 00:16:50 2008 +0100 +++ b/hgext/convert/convcmd.py Sat Jan 26 19:55:04 2008 +0100 @@ -222,15 +222,14 @@ self.mapentry(rev, dest) return files, copies = changes - parents = [self.map[r] for r in commit.parents] + pbranches = [] if commit.parents: - prev = commit.parents[0] - if prev not in self.commitcache: - self.cachecommit(prev) - pbranch = self.commitcache[prev].branch - else: - pbranch = None - self.dest.setbranch(commit.branch, pbranch, parents) + for prev in commit.parents: + if prev not in self.commitcache: + self.cachecommit(prev) + pbranches.append((self.map[prev], + self.commitcache[prev].branch)) + self.dest.setbranch(commit.branch, pbranches) for f, v in files: filenames.append(f) try: @@ -246,6 +245,7 @@ # Merely marks that a copy happened. self.dest.copyfile(copyf, f) + parents = [b[0] for b in pbranches] newnode = self.dest.putcommit(filenames, parents, commit) self.mapentry(rev, newnode)