191
191
# Set the property keyword for PATH. Turn on all possible keywords.
192
192
### todo: Later, take list of keywords to set.
193
193
def keywords_on(path):
194
svntest.actions.run_and_verify_svn(None, None, [], 'propset',
194
svntest.actions.run_and_verify_svn(None, [], 'propset',
196
196
"Author Rev Date URL Id Header",
199
199
# Delete property NAME from versioned PATH in the working copy.
200
200
### todo: Later, take list of keywords to remove from the propval?
201
201
def keywords_off(path):
202
svntest.actions.run_and_verify_svn(None, None, [], 'propdel',
202
svntest.actions.run_and_verify_svn(None, [], 'propdel',
203
203
"svn:keywords", path)
462
459
# Replace contents of rho and set eol translation to 'native'
463
460
rho_path = os.path.join(wc_dir, 'A', 'D', 'G', 'rho')
464
461
svntest.main.file_write(rho_path, "1\n2\n3\n4\n5\n6\n7\n8\n9\n")
465
svntest.actions.run_and_verify_svn(None, None, [],
462
svntest.actions.run_and_verify_svn(None, [],
466
463
'propset', 'svn:eol-style', 'native',
561
570
# commit the file
562
svntest.actions.run_and_verify_svn(None, None, [], 'add', foo_path)
563
svntest.actions.run_and_verify_svn(None, None, [],
571
svntest.actions.run_and_verify_svn(None, [], 'add', foo_path)
572
svntest.actions.run_and_verify_svn(None, [],
564
573
'ci', '-m', 'log msg',
567
576
if svntest.main.windows:
568
svntest.actions.run_and_verify_svn(None, None, [], 'propset',
577
svntest.actions.run_and_verify_svn(None, [], 'propset',
569
578
'svn:eol-style', 'LF', foo_path)
571
svntest.actions.run_and_verify_svn(None, None, [], 'propset',
580
svntest.actions.run_and_verify_svn(None, [], 'propset',
572
581
'svn:eol-style', 'CRLF', foo_path)
574
583
# check 1: did new contents get transmitted?
575
584
expected_output = ["Sending " + foo_path + "\n",
576
"Transmitting file data .\n",
585
"Transmitting file data .done\n",
586
"Committing transaction...\n",
577
587
"Committed revision 3.\n"]
578
svntest.actions.run_and_verify_svn(None, expected_output, [],
588
svntest.actions.run_and_verify_svn(expected_output, [],
579
589
'ci', '-m', 'log msg', foo_path)
581
591
# check 2: do the files have the right contents now?
605
615
# The bug didn't occur if there were multiple files in the
606
616
# directory, so setup an empty directory.
607
617
Z_path = os.path.join(wc_dir, 'Z')
608
svntest.actions.run_and_verify_svn(None, None, [], 'mkdir', Z_path)
618
svntest.actions.run_and_verify_svn(None, [], 'mkdir', Z_path)
610
620
# Add the file that has the keyword to be expanded
611
621
url_path = os.path.join(Z_path, 'url')
612
622
svntest.main.file_append(url_path, "$URL$")
613
svntest.actions.run_and_verify_svn(None, None, [], 'add', url_path)
623
svntest.actions.run_and_verify_svn(None, [], 'add', url_path)
614
624
keywords_on(url_path)
616
svntest.actions.run_and_verify_svn(None, None, [],
626
svntest.actions.run_and_verify_svn(None, [],
617
627
'ci', '-m', 'log msg', wc_dir)
619
629
other_wc_dir = sbox.add_wc_path('other')
620
630
other_url_path = os.path.join(other_wc_dir, 'Z', 'url')
621
svntest.actions.run_and_verify_svn(None, None, [], 'checkout',
631
svntest.actions.run_and_verify_svn(None, [], 'checkout',
646
656
# Set up A/mu to do $Rev$ keyword expansion
647
657
svntest.main.file_append(mu_path , "$Rev$\n$Author$")
648
svntest.actions.run_and_verify_svn(None, None, [],
658
svntest.actions.run_and_verify_svn(None, [],
649
659
'propset', 'svn:keywords', 'Rev Author',
655
665
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
656
666
expected_status.tweak('A/mu', wc_rev=2)
657
667
svntest.actions.run_and_verify_commit(wc_dir,
658
expected_output, expected_status,
668
expected_output, expected_status)
661
670
# Change the author to value which will get truncated on expansion
662
671
full_author = "x" * 400
663
672
key_author = "x" * 244
664
673
svntest.actions.enable_revprop_changes(sbox.repo_dir)
665
svntest.actions.run_and_verify_svn(None, None, [],
674
svntest.actions.run_and_verify_svn(None, [],
666
675
'propset', '--revprop', '-r2',
667
676
'svn:author', full_author,
669
svntest.actions.run_and_verify_svn(None, [ full_author ], [],
678
svntest.actions.run_and_verify_svn([ full_author ], [],
670
679
'propget', '--revprop', '-r2',
671
'svn:author', '--strict',
680
'svn:author', '--no-newline',
674
683
# Make another commit so that the last changed revision for A/mu is
676
svntest.actions.run_and_verify_svn(None, None, [],
685
svntest.actions.run_and_verify_svn(None, [],
677
686
'propset', 'foo', 'bar', lambda_path)
678
687
expected_output = wc.State(wc_dir, {
679
688
'A/B/lambda' : Item(verb='Sending'),
681
690
expected_status.tweak('A/B/lambda', wc_rev=3)
682
691
svntest.actions.run_and_verify_commit(wc_dir,
683
expected_output, expected_status,
692
expected_output, expected_status)
686
694
# At one stage the keywords were expanded to values for the requested
687
695
# revision, not to those committed revision
688
svntest.actions.run_and_verify_svn(None,
689
[ "This is the file 'mu'.\n",
696
svntest.actions.run_and_verify_svn([ "This is the file 'mu'.\n",
691
698
"$Author: " + key_author + " $"], [],
692
699
'cat', '-r', 'HEAD', mu_path)
702
709
mu2_path = os.path.join(wc_dir, 'A', 'mu2')
704
711
# Copy and propset
705
svntest.actions.run_and_verify_svn(None, None, [], 'copy', mu_path, mu2_path)
706
svntest.actions.run_and_verify_svn(None, None, [],
712
svntest.actions.run_and_verify_svn(None, [], 'copy', mu_path, mu2_path)
713
svntest.actions.run_and_verify_svn(None, [],
707
714
'propset', 'svn:eol-style', 'native',
709
716
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
719
726
expected_status.tweak('A/mu2', status=' ', wc_rev=2, copied=None)
720
727
svntest.actions.run_and_verify_commit(wc_dir,
721
expected_output, expected_status,
728
expected_output, expected_status)
724
730
#----------------------------------------------------------------------
725
731
# Create a greek tree, commit a keyword into one file,
741
747
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
742
748
expected_status.tweak('A/mu', wc_rev=2)
743
749
svntest.actions.run_and_verify_commit(wc_dir,
744
expected_output, expected_status,
750
expected_output, expected_status)
747
752
# Set property to do keyword expansion on A/mu, commit.
748
svntest.actions.run_and_verify_svn(None, None, [],
753
svntest.actions.run_and_verify_svn(None, [],
749
754
'propset', 'svn:keywords', 'Rev', mu_path)
750
755
expected_output = wc.State(wc_dir, {
751
756
'A/mu' : Item(verb='Sending'),
753
758
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
754
759
expected_status.tweak('A/mu', wc_rev=3)
755
760
svntest.actions.run_and_verify_commit(wc_dir,
756
expected_output, expected_status,
761
expected_output, expected_status)
759
763
# Check out into another wc dir
760
764
other_wc_dir = sbox.add_wc_path('other')
761
765
mu_other_path = os.path.join(other_wc_dir, 'A', 'mu')
763
svntest.actions.run_and_verify_svn(None, None, [], 'checkout',
767
svntest.actions.run_and_verify_svn(None, [], 'checkout',
783
787
# Set the Rev keyword for the mu file
784
788
# could use the keywords_on()/keywords_off() functions to
785
789
# set/del all svn:keywords
786
svntest.actions.run_and_verify_svn(None, None, [],
790
svntest.actions.run_and_verify_svn(None, [],
787
791
'propset', 'svn:keywords', 'Rev', mu_path)
788
792
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
789
793
expected_status.tweak('A/mu', status=' M')
790
794
svntest.actions.run_and_verify_status(wc_dir, expected_status)
792
796
# Revert the propset
793
svntest.actions.run_and_verify_svn(None, None, [], 'revert', mu_path)
797
svntest.actions.run_and_verify_svn(None, [], 'revert', mu_path)
794
798
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
795
799
svntest.actions.run_and_verify_status(wc_dir, expected_status)
864
862
expected_status = svntest.actions.get_virginal_state(wc_dir, 3)
866
864
svntest.actions.run_and_verify_update(wc_dir,
867
None, expected_disk, expected_status,
869
None, None, None, None,
865
None, expected_disk, expected_status)
873
867
if open(iota_path).read() != ''.join(content):
874
868
raise svntest.Failure("$Author$ is not contracted in 'iota'")
905
899
sbox.simple_add_text(text, 'add.c')
906
900
sbox.simple_add_text(text, 'add-force.c')
908
svntest.actions.run_and_verify_svn(None, None, '.*inconsistent newlines.*',
902
svntest.actions.run_and_verify_svn(None, '.*inconsistent newlines.*',
909
903
'ps', 'svn:eol-style', 'native',
910
904
sbox.ospath('add.c'))
912
svntest.actions.run_and_verify_svn(None, None, [],
906
svntest.actions.run_and_verify_svn(None, [],
913
907
'ps', 'svn:eol-style', 'native', '--force',
914
908
sbox.ospath('add.c'))