Skip to content

Commit b10048d

Browse files
ggibbonsgitster
authored andcommitted
git-p4: fix test for unsupported P4 Client Views
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 <[email protected]> Signed-off-by: Pete Wyckoff <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c700b68 commit b10048d

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

contrib/fast-import/git-p4

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1889,9 +1889,12 @@ class P4Sync(Command, P4UserMap):
18891889

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

18961899
if v.startswith('"'):
18971900
start = 1

t/t9809-git-p4-client-view.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,13 @@ test_expect_success 'init depot' '
8989
'
9090

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

98-
test_expect_failure 'unsupported view wildcard *' '
98+
test_expect_success 'unsupported view wildcard *' '
9999
client_view "//depot/*/bar/... //client/*/bar/..." &&
100100
test_when_finished cleanup_git &&
101101
test_must_fail "$GITP4" clone --use-client-spec --dest="$git" //depot

0 commit comments

Comments
 (0)