git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Cannot fetch whole history from Perforce
@ 2011-03-08 18:09 Anatol Pomozov
  2011-03-08 20:36 ` Thomas Berg
  0 siblings, 1 reply; 4+ messages in thread
From: Anatol Pomozov @ 2011-03-08 18:09 UTC (permalink / raw)
  To: Git Mailing List, pw

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
Importing from //depot/foo/bar into bar
Reinitialized existing Git repository in /home/anatol/tmp/bar/.git/
Reading pipe: git config git-p4.useclientspec
Doing initial import of //depot/foo/bar/ from revision #head into
refs/remotes/p4/master
Reading pipe: git config git-p4.user
Reading pipe: git config git-p4.password
Reading pipe: git config git-p4.port
Reading pipe: git config git-p4.host
Reading pipe: git config git-p4.client
p4 -G files //depot/foo/bar/...#head
Opening pipe: p4 -G files //depot/foo/bar/...#head
commit into refs/remotes/p4/master
p4 -G users
Opening pipe: p4 -G users
p4 -G -x - print
Opening pipe: p4 -G -x - print
...A bunch of files...
executing git branch master refs/remotes/p4/master
executing git checkout -f


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
Initialized empty Git repository in /home/anatol/tmp/bar/.git/
Reading pipe: git config git-p4.useclientspec
Traceback (most recent call last):
  File "/home/anatol/bin/git-p4", line 2033, in <module>
    main()
  File "/home/anatol/bin/git-p4", line 2028, in main
    if not cmd.run(args):
  File "/home/anatol/bin/git-p4", line 1904, in run
    if not P4Sync.run(self, depotPaths):
  File "/home/anatol/bin/git-p4", line 1767, in run
    die("No remote p4 branches.  Perhaps you never did \"git p4
clone\" in here.");
  File "/home/anatol/bin/git-p4", line 59, in die
    raise Exception(msg)
Exception: No remote p4 branches.  Perhaps you never did "git p4 clone" in here.

Can it be related to Pete's changes?
http://permalink.gmane.org/gmane.comp.version-control.git/167281

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

* Re: Cannot fetch whole history from Perforce
  2011-03-08 18:09 Cannot fetch whole history from Perforce Anatol Pomozov
@ 2011-03-08 20:36 ` Thomas Berg
  2011-03-08 22:33   ` Tor Arvid Lund
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Berg @ 2011-03-08 20:36 UTC (permalink / raw)
  To: Anatol Pomozov; +Cc: Git Mailing List, pw

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

Sorry for not testing myself before responding, but in my experience
with Perforce a trailing slash may be significant. Did you try this
format?
$ git p4 clone //depot/foo/bar/@all
If that also fails you may be onto something.

- Thomas

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

* Re: Cannot fetch whole history from Perforce
  2011-03-08 20:36 ` Thomas Berg
@ 2011-03-08 22:33   ` Tor Arvid Lund
  2011-03-12  6:45     ` Anatol Pomozov
  0 siblings, 1 reply; 4+ messages in thread
From: Tor Arvid Lund @ 2011-03-08 22:33 UTC (permalink / raw)
  To: Thomas Berg; +Cc: Anatol Pomozov, Git Mailing List, Pete Wyckoff

On Tue, Mar 8, 2011 at 9:36 PM, Thomas Berg <merlin66b@gmail.com> wrote:
> 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),

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

* Re: Cannot fetch whole history from Perforce
  2011-03-08 22:33   ` Tor Arvid Lund
@ 2011-03-12  6:45     ` Anatol Pomozov
  0 siblings, 0 replies; 4+ messages in thread
From: Anatol Pomozov @ 2011-03-12  6:45 UTC (permalink / raw)
  To: Tor Arvid Lund; +Cc: Thomas Berg, Git Mailing List, Pete Wyckoff

Sorry for the slow response.

On Tue, Mar 8, 2011 at 2:33 PM, Tor Arvid Lund <torarvid@gmail.com> wrote:
> On Tue, Mar 8, 2011 at 9:36 PM, Thomas Berg <merlin66b@gmail.com> wrote:
>> 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),

Yep it fixes the problem for me. Do you have a plan to propose it for upstream?

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

end of thread, other threads:[~2011-03-12  6:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-08 18:09 Cannot fetch whole history from Perforce Anatol Pomozov
2011-03-08 20:36 ` Thomas Berg
2011-03-08 22:33   ` Tor Arvid Lund
2011-03-12  6:45     ` Anatol Pomozov

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