Converting Perforce repositories in to mercurial

1.1k Views Asked by At

I have a perforce repository on Windows machine say (p4). I can access this p4 repo using p4v client by providing IP:PortNumber details.

Now I want to run "hg convert" command on this p4 repository from Linux machine so that p4 will be converted in to "p4-hg" a mercurial repository.

Mercurial is already installed on linux box and "hg convert" extension is also enabled. hg convert command is running perfectly.

I tried to convert p4 to hg using below command on linux box but it's not working:

hg convert http://ipAddressandPortNumber /home/p4-hg

On local machine I am able to convert any perforce repo to mercurial repo. That means, URL path does not work with "hg convert" command?

Please suggest me something.

2

There are 2 best solutions below

1
On

You're correct that the perforce repository needs to be local for Mercurial to convert it. You'll need to copy it locally to convert.

1
On

From a Perforce point of view, your command looks wrong.

If you can connect using p4v, you know the p4 server works. Try something like this (assuming Unix-like operating system, change as appropriate):

$ export P4PORT=ip.ad.re.ss:port
$ p4 login
   ( ... enter your password ...)

$ hg convert //depot/... /home/p4-hg

Assuming the "hg convert" command uses p4 underneath (which I assume it must), then this should help. If that doesn't work, you need to be more specific about the error message and how it is breaking.