git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git-p4: Fix sorting changelists when cloning a Perforce repository
@ 2007-08-13 18:50 Reece Dunn
  2007-08-13 21:45 ` Simon Hausmann
  0 siblings, 1 reply; 3+ messages in thread
From: Reece Dunn @ 2007-08-13 18:50 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 402 bytes --]

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

[-- Attachment #2: 0001-git-p4-Fix-the-sorting-of-changelists-when-cloning.patch --]
[-- Type: text/x-diff, Size: 784 bytes --]

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(-)

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-08-13 23:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-13 18:50 [PATCH] git-p4: Fix sorting changelists when cloning a Perforce repository Reece Dunn
2007-08-13 21:45 ` Simon Hausmann
2007-08-13 23:51   ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).