diff options
author | Pete Wyckoff <pw@padd.com> | 2009-02-18 13:12:14 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-02-23 15:24:08 -0800 |
commit | b4b0ba06f8748348039d56ffa5890590dd9776ee (patch) | |
tree | aa8279035604668213dde59cbe67f6c90550ef59 /contrib | |
parent | Merge branch 'for-junio' of git://source.winehq.org/~julliard/git/git (diff) | |
download | tgif-b4b0ba06f8748348039d56ffa5890590dd9776ee.tar.xz |
git-p4: avoid syncing duplicate changes
When a particular changeset affects multiple depot paths, it
will appear multiple times in the output of "p4 changes".
Filter out the duplicates to avoid the extra empty commits that
this otherwise would create.
Signed-off-by: Pete Wyckoff <pw@padd.com>
Acked-by: Simon Hausmann <simon@lst.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/fast-import/git-p4 | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4 index a85a7b2a58..3832f60225 100755 --- a/contrib/fast-import/git-p4 +++ b/contrib/fast-import/git-p4 @@ -442,13 +442,14 @@ def p4ChangesForPaths(depotPaths, changeRange): output = p4_read_pipe_lines("changes " + ' '.join (["%s...%s" % (p, changeRange) for p in depotPaths])) - changes = [] + changes = {} for line in output: - changeNum = line.split(" ")[1] - changes.append(int(changeNum)) + changeNum = int(line.split(" ")[1]) + changes[changeNum] = True - changes.sort() - return changes + changelist = changes.keys() + changelist.sort() + return changelist class Command: def __init__(self): |