Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit 4c9d7bc

Browse files
committed
Merge branch 'pw/git-p4'
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
2 parents 29a03fa + 6ab1d76 commit 4c9d7bc

20 files changed

+213
-205
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
/git-name-rev
9393
/git-mv
9494
/git-notes
95+
/git-p4
9596
/git-pack-redundant
9697
/git-pack-objects
9798
/git-pack-refs

Documentation/git-p4.txt

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,6 @@ the updated p4 remote branch.
3131

3232
EXAMPLE
3333
-------
34-
* Create an alias for 'git p4', using the full path to the 'git-p4'
35-
script if needed:
36-
+
37-
------------
38-
$ git config --global alias.p4 '!git-p4'
39-
------------
40-
4134
* Clone a repository:
4235
+
4336
------------
@@ -311,19 +304,19 @@ configuration file. This allows future 'git p4 submit' commands to
311304
work properly; the submit command looks only at the variable and does
312305
not have a command-line option.
313306

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

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

326-
The name of the client can be given to git-p4 in multiple ways. The
319+
The name of the client can be given to 'git p4' in multiple ways. The
327320
variable 'git-p4.client' takes precedence if it exists. Otherwise,
328321
normal p4 mechanisms of determining the client are used: environment
329322
variable P4CLIENT, a file referenced by P4CONFIG, or the local host name.

INSTALL

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ Issues of note:
131131
use English. Under autoconf the configure script will do this
132132
automatically if it can't find libintl on the system.
133133

134+
- Python version 2.6 or later is needed to use the git-p4
135+
interface to Perforce.
136+
134137
- Some platform specific issues are dealt with Makefile rules,
135138
but depending on your specific installation, you may not
136139
have all the libraries/tools needed, or you may have

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,7 @@ SCRIPT_PERL += git-send-email.perl
440440
SCRIPT_PERL += git-svn.perl
441441

442442
SCRIPT_PYTHON += git-remote-testgit.py
443+
SCRIPT_PYTHON += git-p4.py
443444

444445
SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH)) \
445446
$(patsubst %.perl,%,$(SCRIPT_PERL)) \

command-list.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ git-mktree plumbingmanipulators
7676
git-mv mainporcelain common
7777
git-name-rev plumbinginterrogators
7878
git-notes mainporcelain
79+
git-p4 foreignscminterface
7980
git-pack-objects plumbingmanipulators
8081
git-pack-redundant plumbinginterrogators
8182
git-pack-refs ancillarymanipulators

contrib/fast-import/git-p4.README

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
The git-p4 script moved to the top-level of the git source directory.
2+
3+
Invoke it as any other git command, like "git p4 clone", for instance.
4+
5+
Note that the top-level git-p4.py script is now the source. It is
6+
built using make to git-p4, which will be installed.
7+
8+
Windows users can copy the git-p4.py source script directly, possibly
9+
invoking it through a batch file called "git-p4.bat" in the same folder.
10+
It should contain just one line:
11+
12+
@python "%~d0%~p0git-p4.py" %*

contrib/fast-import/git-p4.bat

Lines changed: 0 additions & 1 deletion
This file was deleted.

contrib/fast-import/git-p4 renamed to git-p4.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,12 +1129,12 @@ def applyCommit(self, id):
11291129
print "The following files should be scheduled for deletion with p4 delete:"
11301130
print " ".join(filesToDelete)
11311131
die("Please resolve and submit the conflict manually and "
1132-
+ "continue afterwards with git-p4 submit --continue")
1132+
+ "continue afterwards with git p4 submit --continue")
11331133
elif response == "w":
11341134
system(diffcmd + " > patch.txt")
11351135
print "Patch saved to patch.txt in %s !" % self.clientPath
11361136
die("Please resolve and submit the conflict manually and "
1137-
"continue afterwards with git-p4 submit --continue")
1137+
"continue afterwards with git p4 submit --continue")
11381138

11391139
system(applyPatchCmd)
11401140

@@ -1178,8 +1178,8 @@ def applyCommit(self, id):
11781178

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

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

@@ -2254,7 +2254,7 @@ def importHeadRevision(self, revision):
22542254

22552255
details["change"] = newestRevision
22562256

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

24752475
changes.sort()
24762476
else:
2477-
# catch "git-p4 sync" with no new branches, in a repo that
2478-
# does not have any existing git-p4 branches
2477+
# catch "git p4 sync" with no new branches, in a repo that
2478+
# does not have any existing p4 branches
24792479
if len(args) == 0 and not self.p4BranchesInGit:
24802480
die("No remote p4 branches. Perhaps you never did \"git p4 clone\" in here.");
24812481
if self.verbose:

t/lib-git-p4.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
#
2-
# Library code for git-p4 tests
2+
# Library code for git p4 tests
33
#
44

55
. ./test-lib.sh
66

77
if ! test_have_prereq PYTHON; then
8-
skip_all='skipping git-p4 tests; python not available'
8+
skip_all='skipping git p4 tests; python not available'
99
test_done
1010
fi
1111
( p4 -h && p4d -h ) >/dev/null 2>&1 || {
12-
skip_all='skipping git-p4 tests; no p4 or p4d'
12+
skip_all='skipping git p4 tests; no p4 or p4d'
1313
test_done
1414
}
1515

16-
GITP4="$GIT_BUILD_DIR/contrib/fast-import/git-p4"
17-
1816
# Try to pick a unique port: guess a large number, then hope
1917
# no more than one of each test is running.
2018
#

0 commit comments

Comments
 (0)