⇤ ← Revision 1 as of 2010-02-09 15:27:29
Size: 3513
Comment:
|
Size: 5049
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 13: | Line 13: |
Line 14: | Line 15: |
this extension. Making changes to the client specification Views causes problems when synchronizing the repositories, and should be avoided. |
this extension, and the working copy belonging to this client spec must be visible to hg. |
Line 78: | Line 80: |
{{{ [perfarce] keep = True submit = False lowercasepaths = False clientuser = search_regex replacement_string }}} If the '''keep''' option is true (this is default) then the Perfarce extension will keep the p4 workarea updated with the current top of tree in Perforce. If '''keep''' is false then the Perfarce extension does not leave files in the p4 workarea unless it is creating a changelist. If the '''submit''' option is true then Perfarce will automatically submit a changelist when pushing changes to the p4 depot. The default is to create a pending changelist, and let the user review this before submitting, either with p4 submit or hg p4submit. If the '''lowercasepaths''' option is true then the Perfarce extension forces all directory names received from p4 to lowercase, but leaving filenames unchanged. The default is to preserve filenames. The '''clientuser''' option allows for 'cheap' multiuser operation with Perforce. The option argument is split on the first space into a search regular expression and a replacement string. If the regular expression matches the client spec name of an imported p4 changelist then the username for the changelist is changed to the value of the replacement string after it is capitalized. The replacement string can use regex matches to substitute part of the client spec name.An example could be {{{ clientuser = ([a-z]+)\.([a-z-]+)--[a-zA-Z0-9-_.]+ \1 \2 <\1.\2@example.com> }}} which turns "firstname.lastname--my-client-name" into "Firstname Lastname <firstname.lastname@example.com>" |
Perfarce Extension
This extension is not distributed with Mercurial.
Author: Frank Kingswood
Public repository: http://www.kingswood-consulting.co.uk/hg/perfarce
Overview
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, and the working copy belonging to this client spec must be visible to hg.
Commands
- 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.
- this exports 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
- --config perfarce.keep=False
- imports changes from the p4 depot, automatically creating merges of changelists submitted by hg push. If the option
- --config perfarce.keep=False
- --config perfarce.clientuser=search replace
- reports changes in the p4 depot that are not yet in the local repository.
- creates the destination repository and pulls all changes from the p4 depot into it. If the option
- --config perfarce.lowercasepaths=False
Configuration
Configure your .hgrc to enable the extension by adding following lines:
[extensions] perfarce = /path/to/perfarce.py
[perfarce] keep = True submit = False lowercasepaths = False clientuser = search_regex replacement_string
If the keep option is true (this is default) then the Perfarce extension will keep the p4 workarea updated with the current top of tree in Perforce. If keep is false then the Perfarce extension does not leave files in the p4 workarea unless it is creating a changelist.
If the submit option is true then Perfarce will automatically submit a changelist when pushing changes to the p4 depot. The default is to create a pending changelist, and let the user review this before submitting, either with p4 submit or hg p4submit.
If the lowercasepaths option is true then the Perfarce extension forces all directory names received from p4 to lowercase, but leaving filenames unchanged. The default is to preserve filenames.
The clientuser option allows for 'cheap' multiuser operation with Perforce. The option argument is split on the first space into a search regular expression and a replacement string. If the regular expression matches the client spec name of an imported p4 changelist then the username for the changelist is changed to the value of the replacement string after it is capitalized. The replacement string can use regex matches to substitute part of the client spec name.An example could be
clientuser = ([a-z]+)\.([a-z-]+)--[a-zA-Z0-9-_.]+ \1 \2 <\1.\2@example.com>
which turns "firstname.lastname--my-client-name" into "Firstname Lastname <firstname.lastname@example.com>"