diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-11-20 10:34:15 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-11-20 10:34:15 -0800 |
commit | 077ad4a0f20a4b7288ba001a5bb33742ff56e9fa (patch) | |
tree | e2878de910572564f9a7fa966a2bb2fdd6c7aa4c | |
parent | b0c07c8dc4798f1d6cc7bb515ab36f1ae0c58678 (diff) | |
parent | 6b2bf41e6c1c9742c5ad5b5920f48a7b23aa6a50 (diff) | |
download | git-077ad4a0f20a4b7288ba001a5bb33742ff56e9fa.tar.gz |
Merge branch 'pw/maint-p4-rcs-expansion-newline'
I do not have p4 to play with, but looks obviously correct to me.
* pw/maint-p4-rcs-expansion-newline:
git p4: RCS expansion should not span newlines
-rwxr-xr-x | git-p4.py | 2 | ||||
-rwxr-xr-x | t/t9810-git-p4-rcs.sh | 19 |
2 files changed, 20 insertions, 1 deletions
@@ -227,7 +227,7 @@ def p4_keywords_regexp_for_type(base, type_mods): pattern = r""" \$ # Starts with a dollar, followed by... (%s) # one of the keywords, followed by... - (:[^$]+)? # possibly an old expansion, followed by... + (:[^$\n]+)? # possibly an old expansion, followed by... \$ # another dollar """ % kwords return pattern diff --git a/t/t9810-git-p4-rcs.sh b/t/t9810-git-p4-rcs.sh index fe30ad881f..0c2fc3ea1a 100755 --- a/t/t9810-git-p4-rcs.sh +++ b/t/t9810-git-p4-rcs.sh @@ -155,6 +155,25 @@ test_expect_success 'cleanup after failure' ' ) ' +# perl $File:: bug check +test_expect_success 'ktext expansion should not expand multi-line $File::' ' + ( + cd "$cli" && + cat >lv.pm <<-\EOF + my $wanted = sub { my $f = $File::Find::name; + if ( -f && $f =~ /foo/ ) { + EOF + p4 add -t ktext lv.pm && + p4 submit -d "lv.pm" + ) && + test_when_finished cleanup_git && + git p4 clone --dest="$git" //depot && + ( + cd "$git" && + test_cmp "$cli/lv.pm" lv.pm + ) +' + # # Do not scrub anything but +k or +ko files. Sneak a change into # the cli file so that submit will get a conflict. Make sure that |