git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
PWPete Wyckoff <pw@padd.com>
Date
Jan 2, 2012, 23:05 UTC
Message-ID
<1325545554-16540-3-git-send-email-pw@padd.com>
In-Reply-To
<1325545554-16540-1-git-send-email-pw@padd.com>
From: Gary Gibbons <ggibbons@perforce.com>

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>
---
 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
Previous: Pete WyckoffNext: Pete Wyckoff
Message 3 of 7 in “git-p4: view spec improvements”
  1. 0/6 git-p4: view spec improvementsPete Wyckoff, Jan 2, 2012
  2. 1/6 git-p4: test client view handlingPete Wyckoff, Jan 2, 2012
  3. 2/6 git-p4: fix test for unsupported P4 Client ViewsPete Wyckoff, Jan 2, 2012
  4. 3/6 git-p4: sort client views by reverse View numberPete Wyckoff, Jan 2, 2012
  5. 4/6 git-p4: support single file p4 client view mapsPete Wyckoff, Jan 2, 2012
  6. 5/6 git-p4: rewrite view handlingPete Wyckoff, Jan 2, 2012
  7. 6/6 git-p4: view spec documentationPete Wyckoff, Jan 2, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.