Commit graph

12 commits

Author SHA1 Message Date
Pete Wyckoff 23a2666c2e git p4 test: cleanup_git should make a new $git
For convenience, leave one in place at the end of each
test so that it is not necessary to build a new one.  This
makes it consistent with $cli.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-27 21:06:35 -07:00
Pete Wyckoff 08c5eb7ac0 git p4 test: simplify quoting involving TRASH_DIRECTORY
For temporary files that are created in the top-level TRASH_DIRECTORY,
trust that the tests do not chdir except in subshells, and avoid some
quoting.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-27 21:06:34 -07:00
Pete Wyckoff 23bd0c99f7 git p4 test: use real_path to resolve p4 client symlinks
The p4 program is finicky about making sure the recorded client Root
matches the current working directory.  The way it discovers the latter
seems to be to inspect shell variable $PWD.  This could involve symlinks,
that while leading to the same place as the client Root, look different,
and cause p4 to fail.

Resolve all client paths using "test-path-utils real_path $path".  This
removes ".." and resolves all symlinks.

Discovered while running with --root=/dev/shm, which is a link to
/run/shm.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-27 21:06:34 -07:00
Pete Wyckoff 6ab1d76c3c git p4: use "git p4" directly in tests
Drop the $GITP4 variable that was used to specify the script in
contrib/fast-import/.  The command is called "git p4" now, not
"git-p4".

Note that configuration variables will remain in a section called
"git-p4".

Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-04-09 15:00:33 -07:00
Pete Wyckoff 2ea09b5ace git-p4: adjust test to adhere to stricter useClientSpec
This test relied on what now is seen as broken behavior
in --use-client-spec.  Change it to make sure it works
according to the new behavior as described in
ecb7cf9 (git-p4: rewrite view handling, 2012-01-02) and
c700b68 (git-p4: test client view handling, 2012-01-02).

Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-01-11 16:35:38 -08:00
Pete Wyckoff 09fca77b9e git-p4: test and document --use-client-spec
The depot path is required, even with this option.  Make sure
git-p4 fails and exits with non-zero.

Contents in the specified depot path will be rearranged according
to the client spec.  Test this and add a note in the docs.

Leave an XXX suggesting that this is somewhat confusing behavior
that might be good to fix later.

Function stripRepoPath() looks at self.useClientSpec.  Make sure
this is set both for command-line option --use-client-spec and
for configuration variable git-p4.useClientSpec.  Test this.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-12-27 10:19:31 -08:00
Pete Wyckoff ae3f41f20a git-p4: test --keep-path
Make sure it leaves the path, below //depot, in git.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-12-27 10:19:31 -08:00
Pete Wyckoff 7fbe1ce9e2 git-p4: test --max-changes
Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-12-27 10:19:30 -08:00
Pete Wyckoff 5a92a6ce90 git-p4: document and test --import-local
Explain that it is needed on future syncs to find p4 branches
in refs/heads.  Test this behavior.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-12-27 10:19:30 -08:00
Pete Wyckoff 58c8bc7c1a git-p4: honor --changesfile option and test
When an explicit list of changes is given, it makes no sense to
use @all or @3,5 or any of the other p4 revision specifiers.
Make the code notice when this happens, instead of just ignoring
--changesfile.  Test it.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-12-27 10:19:30 -08:00
Pete Wyckoff 1471c6b155 git-p4: document and test clone --branch
Clone with --branch will not checkout HEAD, unless the branch
happens to be called the default refs/remotes/p4/master.  The
--branch option is most useful with sync; give an example of
that.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-12-27 10:19:30 -08:00
Pete Wyckoff ef86890ce5 git-p4: clone does not use --git-dir
Complain if --git-dir is given during a clone.  It has no
effect.  Only --destination and --bare can change where the newly
cloned git dir will be.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-12-27 10:19:30 -08:00