threads / patch / 9515

patchgit-p4: Fix sorting changelists when cloning a Perforce repository

Subject: [PATCH] git-p4: Fix sorting changelists when cloning a Perforce repository

## tl;dr

3 messages between Aug 13, 2007 and Aug 13, 2007. Diffs are folded; open one to read it.

replies: 2people: 3as markdown or json

Reece Dunn· Aug 13, 2007, 18:50 UTC · lore
Hi,

When performing a git-p4 clone operation on a Perforce repository, where the changelists change in order of magnitude (e.g. 100 to 1000), the set of changes to import from is not sorted properly. This is because the data in the list is strings not integers. The other place where this is done already converts the value to an integer, so it is not affected.

This patch fixes this issue.
- Reece
From 8c3d5e2d5886b330d0dfd139f03b3d1fd51207f5 Mon Sep 17 00:00:00 2001
From: Reece H. Dunn <msclrhd@gmail.com>
Date: Mon, 13 Aug 2007 19:40:50 +0100
Subject: [PATCH] git-p4: Fix the sorting of changelists when cloning a Perforce repository.
---
 contrib/fast-import/git-p4 |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Show changes to contrib/fast-import/git-p4 +1 −1
diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index 805d632..6d01062 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -1322,7 +1322,7 @@ class P4Sync(Command):
 
                 for line in output:
                     changeNum = line.split(" ")[1]
-                    changes.append(changeNum)
+                    changes.append(int(changeNum))
 
                 changes.sort()
 
-- 
1.5.1.3
Simon Hausmann· Aug 13, 2007, 21:45 UTC · re: Reece Dunn · lore

Re: [PATCH] git-p4: Fix sorting changelists when cloning a Perforce repository

On Monday 13 August 2007 20:50:59 Reece Dunn wrote:
Show 10 quoted lines
> Hi,
>
> When performing a git-p4 clone operation on a Perforce repository,
> where the changelists change in order of magnitude (e.g. 100 to 1000),
> the set of changes to import from is not sorted properly. This is
> because the data in the list is strings not integers. The other place
> where this is done already converts the value to an integer, so it is
> not affected.
>
> This patch fixes this issue.
Acked-by: Simon Hausmann <simon@lst.de>

Thanks, Simon

← back to recent threads