git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Cannot fetch whole history from Perforce

From
Tor Arvid Lund <torarvid@gmail.com>
Date
Mar 8, 2011, 22:33 UTC
Message-ID
<AANLkTimaB3BU3YQgC7qgqUH=qYGrthPxnz63b-MLAbCR@mail.gmail.com>
In-Reply-To
<AANLkTin6BBD+b2OYRk32GyAaEqFa-V7T1B7jEVujRkuL@mail.gmail.com>
On Tue, Mar 8, 2011 at 9:36 PM, Thomas Berg <merlin66b@gmail.com> wrote:
Show 18 quoted lines
> Hi,
>
> On Tue, Mar 8, 2011 at 7:09 PM, Anatol Pomozov <anatol.pomozov@gmail.com> wrote:
>> Hi, I am using HEAD version of the git and I have an issue with git-p4
>> tool (p4 to git importer).
>>
>> git-p4 works fine when I import HEAD version of my project
>>
>> $ git p4 clone //depot/foo/bar --verbose
>> But it fails with a cryptic error when I try to import @all revisions:
> [...]
>>
>> $ git p4 clone //depot/foo/bar@all --verbose
>> Importing from //depot/foo/bar@all into bar
> [...]
>>
>> Can it be related to Pete's changes?
>> http://permalink.gmane.org/gmane.comp.version-control.git/167281

Whoops! The P4Clone class is a subclass of P4Sync, which means that this check (The one you mention from e32e00dc) will be done on every clone with @all. We can't have that :)

It works for me if I patch it with this one-liner (but it's not exactly a beautiful looking line of code anymore):

    -- Tor Arvid
---
diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index 2df3bb2..7cb479c 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -1763,7 +1763,7 @@ class P4Sync(Command):

                 changes.sort()
             else:
-                if not self.p4BranchesInGit:
+                if not isinstance(self, P4Clone) and not self.p4BranchesInGit:
                     die("No remote p4 branches.  Perhaps you never
did \"git p4 clone\" in here.");
                 if self.verbose:
                     print "Getting p4 changes for %s...%s" % (',
'.join(self.depotPaths),
Previous: Thomas BergNext: Anatol Pomozov
Message 3 of 4 in “Cannot fetch whole history from Perforce”
  1. Anatol PomozovMar 8, 2011
  2. Thomas BergMar 8, 2011
  3. Tor Arvid LundMar 8, 2011
  4. Anatol PomozovMar 12, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.