[PATCH 2/6] git-p4: fix test for unsupported P4 Client Views

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Gary Gibbons <ggibbons@xxxxxxxxxxxx>

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@xxxxxxxxxxxx>
Signed-off-by: Pete Wyckoff <pw@xxxxxxxx>
---
 contrib/fast-import/git-p4    |    5 ++++-
 t/t9809-git-p4-client-view.sh |    4 ++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index d3c3ad8..c144c89 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -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
diff --git a/t/t9809-git-p4-client-view.sh b/t/t9809-git-p4-client-view.sh
index 4259fb3..cbf2213 100755
--- a/t/t9809-git-p4-client-view.sh
+++ b/t/t9809-git-p4-client-view.sh
@@ -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
-- 
1.7.8.1.407.gd70cb

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]