git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git p4 test: Check ignore files with client spec
@ 2013-07-18 23:04 Vitor Antunes
  2013-07-20 13:48 ` Pete Wyckoff
  0 siblings, 1 reply; 3+ messages in thread
From: Vitor Antunes @ 2013-07-18 23:04 UTC (permalink / raw)
  To: git; +Cc: Pete Wyckoff, Luke Diamand, Vitor Antunes

This test confirms that a file can be ignored during git p4 sync if if is
excluded in P4 client specification.

Signed-off-by: Vitor Antunes <vitor.hda@gmail.com>
---
 t/t9801-git-p4-branch.sh | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)

diff --git a/t/t9801-git-p4-branch.sh b/t/t9801-git-p4-branch.sh
index 9730821..2bf142d 100755
--- a/t/t9801-git-p4-branch.sh
+++ b/t/t9801-git-p4-branch.sh
@@ -469,9 +469,11 @@ test_expect_success 'use-client-spec detect-branches skips branches setup' '
 		View: //depot/usecs/b1/... //depot/usecs/b3/...
 		EOF
 
-		echo b3/b3-file3 >b3/b3-file3 &&
-		p4 add b3/b3-file3 &&
-		p4 submit -d "b3/b3-file3"
+		echo b3/b3-file3_1 >b3/b3-file3_1 &&
+		echo b3/b3-file3_2 >b3/b3-file3_2 &&
+		p4 add b3/b3-file3_1 &&
+		p4 add b3/b3-file3_2 &&
+		p4 submit -d "b3/b3-file3_1 b3/b3-file3_2"
 	)
 '
 
@@ -487,6 +489,21 @@ test_expect_success 'use-client-spec detect-branches skips branches' '
 	)
 '
 
+test_expect_success 'use-client-spec detect-branches skips files in branches' '
+	client_view "//depot/usecs/... //client/..." \
+		    "-//depot/usecs/b3/b3-file3_1 //client/b3/b3-file3_1" &&
+	test_when_finished cleanup_git &&
+	test_create_repo "$git" &&
+	(
+		cd "$git" &&
+		git p4 sync --detect-branches --use-client-spec //depot/usecs@all &&
+		git checkout -b master p4/usecs/b3 &&
+		test_path_is_file b1-file1 &&
+		test_path_is_file b3-file3_2 &&
+		test_path_is_missing b3-file3_1
+	)
+'
+
 test_expect_success 'kill p4d' '
 	kill_p4d
 '
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] git p4 test: Check ignore files with client spec
  2013-07-18 23:04 [PATCH] git p4 test: Check ignore files with client spec Vitor Antunes
@ 2013-07-20 13:48 ` Pete Wyckoff
  2013-07-20 14:59   ` Vitor Antunes
  0 siblings, 1 reply; 3+ messages in thread
From: Pete Wyckoff @ 2013-07-20 13:48 UTC (permalink / raw)
  To: Vitor Antunes; +Cc: git, Luke Diamand

vitor.hda@gmail.com wrote on Fri, 19 Jul 2013 00:04 +0100:
> This test confirms that a file can be ignored during git p4 sync if if is
> excluded in P4 client specification.

This is a good check to have, and I'm glad it happens to work.  :)

I'd forgotten during your conversation with Matthieu that we
did indeed have tests for detect-branches with use-client-spec.
This test sure seems like it should cover that situation though.

Acked-by: Pete Wyckoff <pw@padd.com>

> ---
>  t/t9801-git-p4-branch.sh | 23 ++++++++++++++++++++---
>  1 file changed, 20 insertions(+), 3 deletions(-)
> 
> diff --git a/t/t9801-git-p4-branch.sh b/t/t9801-git-p4-branch.sh
> index 9730821..2bf142d 100755
> --- a/t/t9801-git-p4-branch.sh
> +++ b/t/t9801-git-p4-branch.sh
> @@ -469,9 +469,11 @@ test_expect_success 'use-client-spec detect-branches skips branches setup' '
>  		View: //depot/usecs/b1/... //depot/usecs/b3/...
>  		EOF
>  
> -		echo b3/b3-file3 >b3/b3-file3 &&
> -		p4 add b3/b3-file3 &&
> -		p4 submit -d "b3/b3-file3"
> +		echo b3/b3-file3_1 >b3/b3-file3_1 &&
> +		echo b3/b3-file3_2 >b3/b3-file3_2 &&
> +		p4 add b3/b3-file3_1 &&
> +		p4 add b3/b3-file3_2 &&
> +		p4 submit -d "b3/b3-file3_1 b3/b3-file3_2"
>  	)
>  '
>  
> @@ -487,6 +489,21 @@ test_expect_success 'use-client-spec detect-branches skips branches' '
>  	)
>  '
>  
> +test_expect_success 'use-client-spec detect-branches skips files in branches' '
> +	client_view "//depot/usecs/... //client/..." \
> +		    "-//depot/usecs/b3/b3-file3_1 //client/b3/b3-file3_1" &&
> +	test_when_finished cleanup_git &&
> +	test_create_repo "$git" &&
> +	(
> +		cd "$git" &&
> +		git p4 sync --detect-branches --use-client-spec //depot/usecs@all &&
> +		git checkout -b master p4/usecs/b3 &&
> +		test_path_is_file b1-file1 &&
> +		test_path_is_file b3-file3_2 &&
> +		test_path_is_missing b3-file3_1
> +	)
> +'
> +
>  test_expect_success 'kill p4d' '
>  	kill_p4d
>  '
> -- 
> 1.8.3.2
> 
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] git p4 test: Check ignore files with client spec
  2013-07-20 13:48 ` Pete Wyckoff
@ 2013-07-20 14:59   ` Vitor Antunes
  0 siblings, 0 replies; 3+ messages in thread
From: Vitor Antunes @ 2013-07-20 14:59 UTC (permalink / raw)
  To: Pete Wyckoff; +Cc: Git Mailing List, Luke Diamand

On Sat, Jul 20, 2013 at 2:48 PM, Pete Wyckoff <pw@padd.com> wrote:
> I'd forgotten during your conversation with Matthieu that we
> did indeed have tests for detect-branches with use-client-spec.
> This test sure seems like it should cover that situation though.

It was good that you had some tests implemented, otherwise it would
have taken me much more time to implement this ;)

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-07-20 14:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-18 23:04 [PATCH] git p4 test: Check ignore files with client spec Vitor Antunes
2013-07-20 13:48 ` Pete Wyckoff
2013-07-20 14:59   ` Vitor Antunes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).