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 <ggibbons@perforce.com> Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Gary Gibbons committed
Jan 2, 2012 at 18:05 UTC
b10048d0e9c4a209997c3b7f44021af15f88d768
2 files changed
+6
-3
contrib/fast-import/git-p4
+4
-1
@@ -1889,9 +1889,12 @@ class P4Sync(Command, P4UserMap):
1889
1890
# p4 has these %%1 to %%9 arguments in specs to
1891
# reorder paths; which we can't handle (yet :)
1892
- if re.match('%%\d', v) != None:
1892
+ if re.search('%%\d', v) != None:
1893
print "Sorry, can't handle %%n arguments in client specs"
1894
sys.exit(1)
1895
+ if re.search('\*', v) != None:
1896
+ print "Sorry, can't handle * mappings in client specs"
1897
+ sys.exit(1)
1898
1899
if v.startswith('"'):
1900
start = 1
t/t9809-git-p4-client-view.sh
+2
-2
@@ -89,13 +89,13 @@ test_expect_success 'init depot' '
89
'
90
91
# double % for printf
92
-test_expect_failure 'unsupported view wildcard %%n' '
92
+test_expect_success 'unsupported view wildcard %%n' '
93
client_view "//depot/%%%%1/sub/... //client/sub/%%%%1/..." &&
94
test_when_finished cleanup_git &&
95
test_must_fail "$GITP4" clone --use-client-spec --dest="$git" //depot
96
'
97
98
-test_expect_failure 'unsupported view wildcard *' '
98
+test_expect_success 'unsupported view wildcard *' '
99
client_view "//depot/*/bar/... //client/*/bar/..." &&
100
test_when_finished cleanup_git &&
101
test_must_fail "$GITP4" clone --use-client-spec --dest="$git" //depot