Skip to content

Commit

Permalink
git-p4: fix test for unsupported P4 Client Views
Browse files Browse the repository at this point in the history
Change re method in test for unsupported Client View types
(containing %% or *) anywhere in the string rather than
at the begining.

[pw: two tests now succeed]

Signed-off-by: Gary Gibbons <ggibbons@perforce.com>
Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Gary Gibbons authored and Junio C Hamano committed Jan 3, 2012
1 parent c700b68 commit b10048d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion contrib/fast-import/git-p4
Original file line number Diff line number Diff line change
Expand Up @@ -1889,9 +1889,12 @@ class P4Sync(Command, P4UserMap):

# p4 has these %%1 to %%9 arguments in specs to
# reorder paths; which we can't handle (yet :)
if re.match('%%\d', v) != None:
if re.search('%%\d', v) != None:
print "Sorry, can't handle %%n arguments in client specs"
sys.exit(1)
if re.search('\*', v) != None:
print "Sorry, can't handle * mappings in client specs"
sys.exit(1)

if v.startswith('"'):
start = 1
Expand Down
4 changes: 2 additions & 2 deletions t/t9809-git-p4-client-view.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@ test_expect_success 'init depot' '
'

# double % for printf
test_expect_failure 'unsupported view wildcard %%n' '
test_expect_success 'unsupported view wildcard %%n' '
client_view "//depot/%%%%1/sub/... //client/sub/%%%%1/..." &&
test_when_finished cleanup_git &&
test_must_fail "$GITP4" clone --use-client-spec --dest="$git" //depot
'

test_expect_failure 'unsupported view wildcard *' '
test_expect_success 'unsupported view wildcard *' '
client_view "//depot/*/bar/... //client/*/bar/..." &&
test_when_finished cleanup_git &&
test_must_fail "$GITP4" clone --use-client-spec --dest="$git" //depot
Expand Down

0 comments on commit b10048d

Please sign in to comment.