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