git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Reece Dunn" <msclrhd@googlemail.com>
To: git@vger.kernel.org
Subject: [PATCH] git-p4: Fix sorting changelists when cloning a Perforce repository
Date: Mon, 13 Aug 2007 19:50:59 +0100	[thread overview]
Message-ID: <3f4fd2640708131150r1d9fb02ai1f655a22658cb544@mail.gmail.com> (raw)

[-- 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


             reply	other threads:[~2007-08-13 18:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-13 18:50 Reece Dunn [this message]
2007-08-13 21:45 ` [PATCH] git-p4: Fix sorting changelists when cloning a Perforce repository Simon Hausmann
2007-08-13 23:51   ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3f4fd2640708131150r1d9fb02ai1f655a22658cb544@mail.gmail.com \
    --to=msclrhd@googlemail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).