[PATCH 0 of 1] Perforce gateway via 'hg push'

Frank A. Kingswood frank at kingswood-consulting.co.uk
Mon Dec 21 05:33:08 CST 2009


Frank Kingswood wrote:
> Steve Borho wrote:
> 
>> Work has begun on the extension.  I've decided to call it p4export,
>> since we are not committing any changes to Perforce directly from the
>> extension, 'export' is a better term for what it does.
> 
> I've also been hacking at this, and got a working 'push' and 'outgoing'
> in the attached patch.

I've put my extension online here:
	http://www.kingswood-consulting.co.uk/hg/perfarce/

Push to or pull from Perforce depots

This extension modifies the remote repository handling so that 
repository paths that resemble
     p4://p4server[:port]/clientname
cause operations on the named p4 client specification on the p4 server.
The client specification must already exist on the server before using
this extension. Making changes to the client specification Views causes
problems when synchronizing the repositories, and should be avoided.

Four built-in commands are overridden:

     hg outgoing: If the destination repository name starts with p4://
                  then this reports files affected by the revision(s)
                  that are in the local repository but not in the p4
                  depot.

     hg push:     Now can export changes from the local repository to the
                  p4 depot. If no revision is specified then all changes
                  since the last p4 changelist are pushed. In either
                  case, all revisions to be pushed are folded into a
                  single p4 changelist. Optionally the resulting
                  changelist is submitted to the p4 server,
                  controlled by the --submit option to push, or by 

                  setting
                     --config perfarce.submit=True
                  If the option
                     --config perfarce.keep=False
                  is False then after a successful submit the files in
                  the p4 workarea will be deleted.

     hg pull:     Now can import changes from the p4 depot, automatically
                  creating merges of changelists submitted by hg push.
                  If the option
                     --config perfarce.keep=False
                  is False then the import does not leave files in the p4
                  workarea, otherwise the p4 workarea will be updated
                  with the new files.

     hg incoming: If the source repository name starts with p4:// then
                  this reports changes in the p4 depot that are not yet
                  in the local repository.

Two additional commands are implemented:

     hg p4submit:   Submit a changelist to the p4 depot, then update
                    local state.

     hg p4identify: Show the most recent revision that was imported from
                    p4.

Frank
-- 
------------------------------------------------------------------------
Frank A. Kingswood                      frank at kingswood-consulting.co.uk
Cambridge, United Kingdom                               +44-7943-217 571


More information about the Mercurial-devel mailing list