Skip to content

Commit

Permalink
Merge branch 'pw/git-p4'
Browse files Browse the repository at this point in the history
By Pete Wyckoff
* pw/git-p4:
  git p4: use "git p4" directly in tests
  git p4: update name in script
  git-p4: move to toplevel
  • Loading branch information
Junio C Hamano committed Apr 23, 2012
2 parents 29a03fa + 6ab1d76 commit 4c9d7bc
Show file tree
Hide file tree
Showing 20 changed files with 213 additions and 205 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
/git-name-rev
/git-mv
/git-notes
/git-p4
/git-pack-redundant
/git-pack-objects
/git-pack-refs
Expand Down
19 changes: 6 additions & 13 deletions Documentation/git-p4.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,6 @@ the updated p4 remote branch.

EXAMPLE
-------
* Create an alias for 'git p4', using the full path to the 'git-p4'
script if needed:
+
------------
$ git config --global alias.p4 '!git-p4'
------------

* Clone a repository:
+
------------
Expand Down Expand Up @@ -311,19 +304,19 @@ configuration file. This allows future 'git p4 submit' commands to
work properly; the submit command looks only at the variable and does
not have a command-line option.

The full syntax for a p4 view is documented in 'p4 help views'. Git-p4
The full syntax for a p4 view is documented in 'p4 help views'. 'Git p4'
knows only a subset of the view syntax. It understands multi-line
mappings, overlays with '+', exclusions with '-' and double-quotes
around whitespace. Of the possible wildcards, git-p4 only handles
'...', and only when it is at the end of the path. Git-p4 will complain
around whitespace. Of the possible wildcards, 'git p4' only handles
'...', and only when it is at the end of the path. 'Git p4' will complain
if it encounters an unhandled wildcard.

Bugs in the implementation of overlap mappings exist. If multiple depot
paths map through overlays to the same location in the repository,
git-p4 can choose the wrong one. This is hard to solve without
dedicating a client spec just for git-p4.
'git p4' can choose the wrong one. This is hard to solve without
dedicating a client spec just for 'git p4'.

The name of the client can be given to git-p4 in multiple ways. The
The name of the client can be given to 'git p4' in multiple ways. The
variable 'git-p4.client' takes precedence if it exists. Otherwise,
normal p4 mechanisms of determining the client are used: environment
variable P4CLIENT, a file referenced by P4CONFIG, or the local host name.
Expand Down
3 changes: 3 additions & 0 deletions INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ Issues of note:
use English. Under autoconf the configure script will do this
automatically if it can't find libintl on the system.

- Python version 2.6 or later is needed to use the git-p4
interface to Perforce.

- Some platform specific issues are dealt with Makefile rules,
but depending on your specific installation, you may not
have all the libraries/tools needed, or you may have
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@ SCRIPT_PERL += git-send-email.perl
SCRIPT_PERL += git-svn.perl

SCRIPT_PYTHON += git-remote-testgit.py
SCRIPT_PYTHON += git-p4.py

SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH)) \
$(patsubst %.perl,%,$(SCRIPT_PERL)) \
Expand Down
1 change: 1 addition & 0 deletions command-list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ git-mktree plumbingmanipulators
git-mv mainporcelain common
git-name-rev plumbinginterrogators
git-notes mainporcelain
git-p4 foreignscminterface
git-pack-objects plumbingmanipulators
git-pack-redundant plumbinginterrogators
git-pack-refs ancillarymanipulators
Expand Down
12 changes: 12 additions & 0 deletions contrib/fast-import/git-p4.README
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
The git-p4 script moved to the top-level of the git source directory.

Invoke it as any other git command, like "git p4 clone", for instance.

Note that the top-level git-p4.py script is now the source. It is
built using make to git-p4, which will be installed.

Windows users can copy the git-p4.py source script directly, possibly
invoking it through a batch file called "git-p4.bat" in the same folder.
It should contain just one line:

@python "%~d0%~p0git-p4.py" %*
1 change: 0 additions & 1 deletion contrib/fast-import/git-p4.bat

This file was deleted.

14 changes: 7 additions & 7 deletions contrib/fast-import/git-p4 → git-p4.py
Original file line number Diff line number Diff line change
Expand Up @@ -1129,12 +1129,12 @@ def applyCommit(self, id):
print "The following files should be scheduled for deletion with p4 delete:"
print " ".join(filesToDelete)
die("Please resolve and submit the conflict manually and "
+ "continue afterwards with git-p4 submit --continue")
+ "continue afterwards with git p4 submit --continue")
elif response == "w":
system(diffcmd + " > patch.txt")
print "Patch saved to patch.txt in %s !" % self.clientPath
die("Please resolve and submit the conflict manually and "
"continue afterwards with git-p4 submit --continue")
"continue afterwards with git p4 submit --continue")

system(applyPatchCmd)

Expand Down Expand Up @@ -1178,8 +1178,8 @@ def applyCommit(self, id):

if self.checkAuthorship and not self.p4UserIsMe(p4User):
submitTemplate += "######## git author %s does not match your p4 account.\n" % gitEmail
submitTemplate += "######## Use git-p4 option --preserve-user to modify authorship\n"
submitTemplate += "######## Use git-p4 config git-p4.skipUserNameCheck hides this message.\n"
submitTemplate += "######## Use option --preserve-user to modify authorship.\n"
submitTemplate += "######## Variable git-p4.skipUserNameCheck hides this message.\n"

separatorLine = "######## everything below this line is just the diff #######\n"

Expand Down Expand Up @@ -2254,7 +2254,7 @@ def importHeadRevision(self, revision):

details["change"] = newestRevision

# Use time from top-most change so that all git-p4 clones of
# Use time from top-most change so that all git p4 clones of
# the same p4 repo have the same commit SHA1s.
res = p4CmdList("describe -s %d" % newestRevision)
newestTime = None
Expand Down Expand Up @@ -2474,8 +2474,8 @@ def run(self, args):

changes.sort()
else:
# catch "git-p4 sync" with no new branches, in a repo that
# does not have any existing git-p4 branches
# catch "git p4 sync" with no new branches, in a repo that
# does not have any existing p4 branches
if len(args) == 0 and not self.p4BranchesInGit:
die("No remote p4 branches. Perhaps you never did \"git p4 clone\" in here.");
if self.verbose:
Expand Down
8 changes: 3 additions & 5 deletions t/lib-git-p4.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
#
# Library code for git-p4 tests
# Library code for git p4 tests
#

. ./test-lib.sh

if ! test_have_prereq PYTHON; then
skip_all='skipping git-p4 tests; python not available'
skip_all='skipping git p4 tests; python not available'
test_done
fi
( p4 -h && p4d -h ) >/dev/null 2>&1 || {
skip_all='skipping git-p4 tests; no p4 or p4d'
skip_all='skipping git p4 tests; no p4 or p4d'
test_done
}

GITP4="$GIT_BUILD_DIR/contrib/fast-import/git-p4"

# Try to pick a unique port: guess a large number, then hope
# no more than one of each test is running.
#
Expand Down
Loading

0 comments on commit 4c9d7bc

Please sign in to comment.