~ubuntu-branches/debian/sid/subversion/sid

« back to all changes in this revision

Viewing changes to subversion/tests/cmdline/prop_tests.py

  • Committer: Package Import Robot
  • Author(s): James McCoy
  • Date: 2015-08-07 21:32:47 UTC
  • mfrom: (0.2.15) (4.1.7 experimental)
  • Revision ID: package-import@ubuntu.com-20150807213247-ozyewtmgsr6tkewl
Tags: 1.9.0-1
* Upload to unstable
* New upstream release.
  + Security fixes
    - CVE-2015-3184: Mixed anonymous/authenticated path-based authz with
      httpd 2.4
    - CVE-2015-3187: svn_repos_trace_node_locations() reveals paths hidden
      by authz
* Add >= 2.7 requirement for python-all-dev Build-Depends, needed to run
  tests.
* Remove Build-Conflicts against ruby-test-unit.  (Closes: #791844)
* Remove patches/apache_module_dependency in favor of expressing the
  dependencies in authz_svn.load/dav_svn.load.
* Build-Depend on apache2-dev (>= 2.4.16) to ensure ap_some_authn_required()
  is available when building mod_authz_svn and Depend on apache2-bin (>=
  2.4.16) for runtime support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
100
100
 
101
101
  # Edit without actually changing the property
102
102
  svntest.main.use_editor('identity')
103
 
  svntest.actions.run_and_verify_svn(None,
104
 
                                     "No changes to property 'editme' on '.*'",
 
103
  svntest.actions.run_and_verify_svn("No changes to property 'editme' on '.*'",
105
104
                                     [],
106
105
                                     'propedit', 'editme',
107
106
                                     os.path.join(wc_dir, 'A', 'mu'))
134
133
  # Commit the one file.
135
134
  svntest.actions.run_and_verify_commit(wc_dir,
136
135
                                        expected_output,
137
 
                                        expected_status,
138
 
                                        None,
139
 
                                        wc_dir)
 
136
                                        expected_status)
140
137
 
141
138
 
142
139
 
170
167
 
171
168
  # Commit property mods
172
169
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
173
 
                                        expected_status,
174
 
                                        None, wc_dir)
 
170
                                        expected_status)
175
171
 
176
172
  # Add more properties
177
173
  sbox.simple_propset('blue2', 'azul2', 'A/mu')
178
174
  sbox.simple_propset('red2', 'rojo2', 'A/D/H')
179
175
  expected_status.tweak('A/mu', 'A/D/H', wc_rev=3, status='  ')
180
176
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
181
 
                                        expected_status,
182
 
                                        None, wc_dir)
 
177
                                        expected_status)
183
178
 
184
179
  # Create expected output tree for an update of the wc_backup.
185
180
  expected_output = svntest.wc.State(wc_backup, {
202
197
                                        expected_output,
203
198
                                        expected_disk,
204
199
                                        expected_status,
205
 
                                        None, None, None, None, None, 1,
 
200
                                        [], 1,
206
201
                                        '-r', '2', wc_backup)
207
202
 
208
203
  # This adds properties to nodes that have properties
215
210
                                        expected_output,
216
211
                                        expected_disk,
217
212
                                        expected_status,
218
 
                                        None, None, None, None, None, 1,
 
213
                                        [], 1,
219
214
                                        '-r', '3', wc_backup)
220
215
 
221
216
 
244
239
 
245
240
  # Commit the one file.
246
241
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
247
 
                                        expected_status,
248
 
                                        None, wc_dir)
 
242
                                        expected_status)
249
243
 
250
244
  # Make some mod (something to commit)
251
245
  svntest.main.file_append(mu_path, "some mod")
262
256
 
263
257
  # Commit the one file.
264
258
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
265
 
                                        expected_status,
266
 
                                        None, wc_dir)
 
259
                                        expected_status)
267
260
 
268
261
  # Create expected output tree for an update.
269
262
  expected_output = svntest.wc.State(wc_dir, {
282
275
                                        expected_output,
283
276
                                        expected_disk,
284
277
                                        expected_status,
285
 
                                        None, None, None, None, None, 1,
 
278
                                        [], 1,
286
279
                                        '-r', '1', wc_dir)
287
280
 
288
281
#----------------------------------------------------------------------
314
307
 
315
308
  # Commit the one file.
316
309
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
317
 
                                        expected_status,
318
 
                                        None, wc_dir)
 
310
                                        expected_status)
319
311
 
320
312
#----------------------------------------------------------------------
321
313
 
363
355
                                        expected_output,
364
356
                                        expected_disk,
365
357
                                        expected_status,
366
 
                                        None,
367
 
                                        svntest.tree.detect_conflict_files,
368
 
                                        extra_files,
369
 
                                        None, None, 1)
370
 
 
371
 
  if len(extra_files) != 0:
372
 
    logger.warn("didn't get expected conflict files")
373
 
    raise svntest.verify.SVNUnexpectedOutput
 
358
                                        check_props=True,
 
359
                                        extra_files=extra_files)
374
360
 
375
361
  # Resolve the conflicts
376
362
  svntest.actions.run_and_verify_resolved([mu_path, A_path])
405
391
  sbox.simple_propset('foo', 'eek', '')
406
392
 
407
393
  svntest.actions.run_and_verify_commit(wc_dir, None, None,
408
 
                                        "[oO]ut[- ]of[- ]date",
409
 
                                        wc_dir)
 
394
                                        ".*[oO]ut[- ]of[- ]date.*")
410
395
 
411
396
#----------------------------------------------------------------------
412
397
 
465
450
  expected_status.tweak('A/B/lambda', wc_rev=3, status='  ')
466
451
 
467
452
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
468
 
                                        expected_status,
469
 
                                        None, wc_dir)
 
453
                                        expected_status)
470
454
 
471
455
#----------------------------------------------------------------------
472
456
 
530
514
                                        expected_output,
531
515
                                        expected_disk,
532
516
                                        expected_status,
533
 
                                        None, None, None, None, None,
534
 
                                        1)
 
517
                                        check_props=True)
535
518
 
536
519
#----------------------------------------------------------------------
537
520
@Issues(920,2065)
550
533
  svntest.actions.run_and_verify_status(wc_dir, expected_status)
551
534
 
552
535
  # These should produce an error
553
 
  svntest.actions.run_and_verify_svn('Illegal target',
554
 
                                     None, svntest.verify.AnyOutput,
 
536
  svntest.actions.run_and_verify_svn(None, svntest.verify.AnyOutput,
555
537
                                     'propset', 'svn:executable', 'on', A_path)
556
538
 
557
 
  svntest.actions.run_and_verify_svn('Illegal target', None,
 
539
  svntest.actions.run_and_verify_svn(None,
558
540
                                     svntest.verify.AnyOutput, 'propset',
559
541
                                     'svn:keywords', 'LastChangedDate',
560
542
                                     A_path)
561
543
 
562
 
  svntest.actions.run_and_verify_svn('Illegal target', None,
 
544
  svntest.actions.run_and_verify_svn(None,
563
545
                                     svntest.verify.AnyOutput, 'propset',
564
546
                                     'svn:eol-style', 'native', A_path)
565
547
 
566
 
  svntest.actions.run_and_verify_svn('Invalid svn:eol-style', None,
 
548
  svntest.actions.run_and_verify_svn(None,
567
549
                                     svntest.verify.AnyOutput, 'propset',
568
550
                                     'svn:eol-style', 'invalid value',
569
551
                                     os.path.join(A_path, 'mu'))
570
552
 
571
 
  svntest.actions.run_and_verify_svn('Illegal target', None,
 
553
  svntest.actions.run_and_verify_svn(None,
572
554
                                     svntest.verify.AnyOutput, 'propset',
573
555
                                     'svn:mime-type', 'image/png', A_path)
574
556
 
575
 
  svntest.actions.run_and_verify_svn('Illegal target', None,
 
557
  svntest.actions.run_and_verify_svn(None,
576
558
                                     svntest.verify.AnyOutput, 'propset',
577
559
                                     'svn:ignore', '*.o', iota_path)
578
560
 
579
 
  svntest.actions.run_and_verify_svn('Illegal target', None,
 
561
  svntest.actions.run_and_verify_svn(None,
580
562
                                     svntest.verify.AnyOutput, 'propset',
581
563
                                     'svn:externals',
582
564
                                     'foo http://host.com/repos', iota_path)
583
565
 
584
 
  svntest.actions.run_and_verify_svn('Illegal target', None,
 
566
  svntest.actions.run_and_verify_svn(None,
585
567
                                     svntest.verify.AnyOutput, 'propset',
586
568
                                     'svn:author', 'socrates', iota_path)
587
569
 
588
 
  svntest.actions.run_and_verify_svn('Illegal target', None,
 
570
  svntest.actions.run_and_verify_svn(None,
589
571
                                     svntest.verify.AnyOutput, 'propset',
590
572
                                     'svn:log', 'log message', iota_path)
591
573
 
592
 
  svntest.actions.run_and_verify_svn('Illegal target', None,
 
574
  svntest.actions.run_and_verify_svn(None,
593
575
                                     svntest.verify.AnyOutput, 'propset',
594
576
                                     'svn:date', 'Tue Jan 19 04:14:07 2038',
595
577
                                     iota_path)
596
578
 
597
 
  svntest.actions.run_and_verify_svn('Illegal target', None,
 
579
  svntest.actions.run_and_verify_svn(None,
598
580
                                     svntest.verify.AnyOutput, 'propset',
599
581
                                     'svn:original-date',
600
582
                                     'Thu Jan  1 01:00:00 1970', iota_path)
603
585
  svntest.actions.run_and_verify_status(wc_dir, expected_status)
604
586
 
605
587
  # Recursive setting of inappropriate dir prop should work on files
606
 
  svntest.actions.run_and_verify_svn(None, None, [], 'propset', '-R',
 
588
  svntest.actions.run_and_verify_svn(None, [], 'propset', '-R',
607
589
                                     'svn:executable', 'on', E_path)
608
590
 
609
591
  expected_status.tweak('A/B/E/alpha', 'A/B/E/beta', status=' M')
620
602
                       'propset', 'svn:mime-type', 'application/octet-stream',
621
603
                       sbox.ospath('binary'))
622
604
 
623
 
  svntest.actions.run_and_verify_svn('Illegal target', None,
 
605
  svntest.actions.run_and_verify_svn(None,
624
606
                                     svntest.verify.AnyOutput,
625
607
                                     'propset', 'svn:eol-style',
626
608
                                     'CRLF', path)
629
611
  svntest.main.file_append(path, "line1\rline2\n")
630
612
  sbox.simple_add('multi-eol')
631
613
 
632
 
  svntest.actions.run_and_verify_svn('Illegal target', None,
 
614
  svntest.actions.run_and_verify_svn(None,
633
615
                                     svntest.verify.AnyOutput,
634
616
                                     'propset', 'svn:eol-style',
635
617
                                     'LF', path)
638
620
  svntest.main.file_append(path, "line1\n\r")
639
621
  sbox.simple_add('backwards-eol')
640
622
 
641
 
  svntest.actions.run_and_verify_svn('Illegal target', None,
 
623
  svntest.actions.run_and_verify_svn(None,
642
624
                                     svntest.verify.AnyOutput,
643
625
                                     'propset', 'svn:eol-style',
644
626
                                     'native', path)
647
629
  svntest.main.file_append(path, "line1\r\n\r")
648
630
  sbox.simple_add('incomplete-eol')
649
631
 
650
 
  svntest.actions.run_and_verify_svn('Illegal target', None,
 
632
  svntest.actions.run_and_verify_svn(None,
651
633
                                     svntest.verify.AnyOutput,
652
634
                                     'propset', 'svn:eol-style',
653
635
                                     'CR', path)
657
639
 
658
640
  path = sbox.ospath('binary')
659
641
  svntest.main.file_append(path, "binary")
660
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
642
  svntest.actions.run_and_verify_svn(None, [],
661
643
                                     'propset', '--force',
662
644
                                     'svn:eol-style', 'CRLF',
663
645
                                     path)
664
646
 
665
647
  path = sbox.ospath('multi-eol')
666
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
648
  svntest.actions.run_and_verify_svn(None, [],
667
649
                                     'propset', '--force',
668
650
                                     'svn:eol-style', 'LF',
669
651
                                     path)
670
652
 
671
653
  path = sbox.ospath('backwards-eol')
672
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
654
  svntest.actions.run_and_verify_svn(None, [],
673
655
                                     'propset', '--force',
674
656
                                     'svn:eol-style', 'native',
675
657
                                     path)
676
658
 
677
659
  path = sbox.ospath('incomplete-eol')
678
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
660
  svntest.actions.run_and_verify_svn(None, [],
679
661
                                     'propset', '--force',
680
662
                                     'svn:eol-style', 'CR',
681
663
                                     path)
684
666
  path = sbox.ospath('A/D')
685
667
 
686
668
  # ...grammatically incorrect
687
 
  svntest.actions.run_and_verify_svn('illegal grammar', None,
 
669
  svntest.actions.run_and_verify_svn(None,
688
670
                                     "svn: E200020: Pathname not terminated by ':'\n",
689
671
                                     'propset', SVN_PROP_MERGEINFO, '/trunk',
690
672
                                     path)
691
 
  svntest.actions.run_and_verify_svn('illegal grammar', None,
 
673
  svntest.actions.run_and_verify_svn(None,
692
674
                                     "svn: E200022: Invalid revision number found "
693
675
                                      "parsing 'one'\n",
694
676
                                     'propset', SVN_PROP_MERGEINFO,
695
677
                                     '/trunk:one', path)
696
678
 
697
679
  # ...contain overlapping revision ranges of differing inheritability.
698
 
  svntest.actions.run_and_verify_svn('overlapping ranges', None,
 
680
  svntest.actions.run_and_verify_svn(None,
699
681
                                     "svn: E200020: Unable to parse overlapping "
700
682
                                     "revision ranges '9-20\\*' and "
701
683
                                     "'18-22' with different "
703
685
                                     'propset', SVN_PROP_MERGEINFO,
704
686
                                     '/branch:5-7,9-20*,18-22', path)
705
687
 
706
 
  svntest.actions.run_and_verify_svn('overlapping ranges', None,
 
688
  svntest.actions.run_and_verify_svn(None,
707
689
                                     "svn: E200020: Unable to parse overlapping "
708
690
                                     "revision ranges "
709
691
                                     "(('3' and '3\\*')|('3\\*' and '3')) "
714
696
 
715
697
  # ...contain revision ranges with start revisions greater than or
716
698
  #    equal to end revisions.
717
 
  svntest.actions.run_and_verify_svn('range start >= range end', None,
 
699
  svntest.actions.run_and_verify_svn(None,
718
700
                                     "svn: E200020: Unable to parse reversed "
719
701
                                      "revision range '20-5'\n",
720
702
                                     'propset', SVN_PROP_MERGEINFO,
721
703
                                     '/featureX:4,20-5', path)
722
704
 
723
705
  # ...contain paths mapped to empty revision ranges
724
 
  svntest.actions.run_and_verify_svn('empty ranges', None,
 
706
  svntest.actions.run_and_verify_svn(None,
725
707
                                     "svn: E200020: Mergeinfo for '/trunk' maps to "
726
708
                                      "an empty revision range\n",
727
709
                                     'propset', SVN_PROP_MERGEINFO,
728
710
                                     '/trunk:', path)
729
711
 
730
712
  # ...contain non-inheritable ranges when the target is a file.
731
 
  svntest.actions.run_and_verify_svn('empty ranges', None,
 
713
  svntest.actions.run_and_verify_svn(None,
732
714
                                     "svn: E200020: Cannot set non-inheritable "
733
715
                                     "mergeinfo on a non-directory*",
734
716
                                     'propset', SVN_PROP_MERGEINFO,
808
790
# non-Posix platforms, we won't have to skip here:
809
791
@Skip(is_non_posix_and_non_windows_os)
810
792
@Issue(3086)
811
 
@XFail(svntest.main.is_ra_type_dav)
812
793
def revprop_change(sbox):
813
794
  "set, get, and delete a revprop change"
814
795
 
815
796
  sbox.build()
816
797
 
817
798
  # First test the error when no revprop-change hook exists.
818
 
  svntest.actions.run_and_verify_svn(None, None, '.*pre-revprop-change',
 
799
  svntest.actions.run_and_verify_svn(None, '.*pre-revprop-change',
819
800
                                     'propset', '--revprop', '-r', '0',
820
801
                                     'cash-sound', 'cha-ching!', sbox.wc_dir)
821
802
 
822
803
  # Now test error output from revprop-change hook.
823
804
  svntest.actions.disable_revprop_changes(sbox.repo_dir)
824
 
  svntest.actions.run_and_verify_svn(None, None, '.*pre-revprop-change.* 0 jrandom cash-sound A',
 
805
  svntest.actions.run_and_verify_svn(None, '.*pre-revprop-change.* 0 jrandom cash-sound A',
825
806
                                     'propset', '--revprop', '-r', '0',
826
807
                                     'cash-sound', 'cha-ching!', sbox.wc_dir)
827
808
 
828
809
  # Create the revprop-change hook for this test
829
810
  svntest.actions.enable_revprop_changes(sbox.repo_dir)
830
811
 
831
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
812
  svntest.actions.run_and_verify_svn(None, [],
832
813
                                     'propset', '--revprop', '-r', '0',
833
814
                                     'cash-sound', 'cha-ching!', sbox.wc_dir)
834
815
 
835
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
816
  svntest.actions.run_and_verify_svn(None, [],
836
817
                                     'propget', '--revprop', '-r', '0',
837
818
                                     'cash-sound', sbox.wc_dir)
838
819
 
839
820
  # Now test that blocking the revprop delete.
840
821
  svntest.actions.disable_revprop_changes(sbox.repo_dir)
841
 
  svntest.actions.run_and_verify_svn(None, None, '.*pre-revprop-change.* 0 jrandom cash-sound D',
 
822
  svntest.actions.run_and_verify_svn(None, '.*pre-revprop-change.* 0 jrandom cash-sound D',
842
823
                                     'propdel', '--revprop', '-r', '0',
843
824
                                     'cash-sound', sbox.wc_dir)
844
825
 
845
826
  # Now test actually deleting the revprop.
846
827
  svntest.actions.enable_revprop_changes(sbox.repo_dir)
847
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
828
  svntest.actions.run_and_verify_svn(None, [],
848
829
                                     'propdel', '--revprop', '-r', '0',
849
830
                                     'cash-sound', sbox.wc_dir)
850
831
 
851
 
  actual_exit, actual_stdout, actual_stderr = svntest.main.run_svn(
852
 
    None, 'pg', '--revprop', '-r', '0', 'cash-sound', sbox.wc_dir)
853
 
 
854
832
  # The property should have been deleted.
855
 
  regex = 'cha-ching'
856
 
  for line in actual_stdout:
857
 
    if re.match(regex, line):
858
 
      raise svntest.Failure
 
833
  svntest.actions.run_and_verify_svn(None,
 
834
    '.*(E195011|E200017).*cash-sound.*',
 
835
    'propget', '--revprop', '-r', '0', 'cash-sound', sbox.wc_dir)
859
836
 
860
837
 
861
838
#----------------------------------------------------------------------
910
887
  svntest.actions.set_prop('some-prop', 'bar\n', iota_path)
911
888
 
912
889
  # NOTE: When writing out multi-line prop values in svn:* props, the
913
 
  # client converts to local encoding and local eoln style.
 
890
  # client converts to local encoding and local eol style.
914
891
  # Therefore, the expected output must contain the right kind of eoln
915
892
  # strings. That's why we use os.linesep in the tests below, not just
916
893
  # plain '\n'. The _last_ \n is also from the client, but it's not
1008
985
  # Commit the propsets.
1009
986
  svntest.actions.run_and_verify_commit(wc_dir,
1010
987
                                        expected_output,
1011
 
                                        expected_status,
1012
 
                                        None,
1013
 
                                        wc_dir)
 
988
                                        expected_status)
1014
989
 
1015
990
  # Create expected output, disk, and status trees for an update of
1016
991
  # the wc_backup.
1028
1003
  svntest.actions.run_and_verify_update(wc_backup,
1029
1004
                                        expected_output,
1030
1005
                                        expected_disk,
1031
 
                                        expected_status,
1032
 
                                        None, None, None, None, None, 0)
 
1006
                                        expected_status)
1033
1007
 
1034
1008
  # Now, check those properties.
1035
1009
  svntest.actions.check_prop('prop_zb', B_path_bak, [prop_zb])
1121
1095
    })
1122
1096
  svntest.actions.run_and_verify_status(wc_dir, expected_status)
1123
1097
 
1124
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1098
  svntest.actions.run_and_verify_svn(None, [],
1125
1099
                                     'propset', '-R', 'svn:keywords', 'Date',
1126
1100
                                     os.path.join(wc_dir, 'A', 'B'))
1127
1101
  expected_status.tweak('A/B/lambda', 'A/B/E/alpha', 'A/B/E/beta', status=' M')
1159
1133
  sbox.simple_commit()
1160
1134
 
1161
1135
  # Test propget
1162
 
  svntest.actions.run_and_verify_svn(None, [ propval1 + '\n' ], [],
 
1136
  svntest.actions.run_and_verify_svn([ propval1 + '\n' ], [],
1163
1137
                                     'propget', prop1, iota_url)
1164
 
  svntest.actions.run_and_verify_svn(None, [ propval1 + '\n' ], [],
 
1138
  svntest.actions.run_and_verify_svn([ propval1 + '\n' ], [],
1165
1139
                                     'propget', prop1, A_url)
1166
1140
 
1167
1141
  # Test normal proplist
1197
1171
                       'propedit', prop1, '-m', 'editlog', iota_url)
1198
1172
  svntest.main.run_svn(None,
1199
1173
                       'propedit', prop1, '-m', 'editlog', A_url)
1200
 
  svntest.actions.run_and_verify_svn(None, [ propval1 + '\n' ], [],
 
1174
  svntest.actions.run_and_verify_svn([ propval1 + '\n' ], [],
1201
1175
                                     'propget', prop1, iota_url)
1202
 
  svntest.actions.run_and_verify_svn(None, [ propval1 + '\n' ], [],
 
1176
  svntest.actions.run_and_verify_svn([ propval1 + '\n' ], [],
1203
1177
                                     'propget', prop1, A_url)
1204
1178
 
1205
1179
  # Edit without actually changing the property
1206
1180
  svntest.main.use_editor('identity')
1207
 
  svntest.actions.run_and_verify_svn(None,
1208
 
                                     "No changes to property '%s' on '.*'"
 
1181
  svntest.actions.run_and_verify_svn("No changes to property '%s' on '.*'"
1209
1182
                                       % prop1,
1210
1183
                                     [],
1211
1184
                                     'propedit', prop1, '-m', 'nocommit',
1233
1206
  # create new fs file
1234
1207
  open(newfile_path, 'w').close()
1235
1208
  # Add it and set a property
1236
 
  svntest.actions.run_and_verify_svn(None, file_add_output, [], 'add', newfile_path)
1237
 
  svntest.actions.run_and_verify_svn(None, propset_output, [], 'propset',
 
1209
  svntest.actions.run_and_verify_svn(file_add_output, [], 'add', newfile_path)
 
1210
  svntest.actions.run_and_verify_svn(propset_output, [], 'propset',
1238
1211
                                     'newprop', 'newvalue', newfile_path)
1239
 
  svntest.actions.run_and_verify_svn(None, propls_output, [],
 
1212
  svntest.actions.run_and_verify_svn(propls_output, [],
1240
1213
                                     'proplist', '-v', newfile_path)
1241
1214
  # remove the file
1242
 
  svntest.actions.run_and_verify_svn(None, file_rm_output, [],
 
1215
  svntest.actions.run_and_verify_svn(file_rm_output, [],
1243
1216
                                     'rm', '--force', newfile_path)
1244
1217
  # recreate the file and add it again
1245
1218
  open(newfile_path, 'w').close()
1246
 
  svntest.actions.run_and_verify_svn(None, file_add_output, [], 'add', newfile_path)
 
1219
  svntest.actions.run_and_verify_svn(file_add_output, [], 'add', newfile_path)
1247
1220
 
1248
1221
  # Now there should be NO properties leftover...
1249
 
  svntest.actions.run_and_verify_svn(None, [], [],
 
1222
  svntest.actions.run_and_verify_svn([], [],
1250
1223
                                     'proplist', '-v', newfile_path)
1251
1224
 
1252
1225
#----------------------------------------------------------------------
1276
1249
 
1277
1250
  # Commit the working copy
1278
1251
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
1279
 
                                        expected_status,
1280
 
                                        None, wc_dir)
 
1252
                                        expected_status)
1281
1253
 
1282
1254
 # Create expected output tree for an update of the wc_backup.
1283
1255
  expected_output = svntest.wc.State(wc_backup, {
1297
1269
                                        expected_output,
1298
1270
                                        expected_disk,
1299
1271
                                        expected_status,
1300
 
                                        None, None, None, None, None, 1)
 
1272
                                        check_props=True)
1301
1273
 
1302
1274
# test for issue 2743
1303
1275
@Issue(2743)
1449
1421
 
1450
1422
  expected_stdout = (".*Attempting to delete nonexistent property "
1451
1423
                     "'%s'.*" % (propname,))
1452
 
  svntest.actions.run_and_verify_svn(None, expected_stdout, [],
 
1424
  svntest.actions.run_and_verify_svn(expected_stdout, [],
1453
1425
                                     'propdel', propname)
1454
1426
  expected_stderr = (".*'%s' is not a valid Subversion"
1455
1427
                     ' property name' % (propname,))
1456
 
  svntest.actions.run_and_verify_svn(None, None, expected_stderr,
 
1428
  svntest.actions.run_and_verify_svn(None, expected_stderr,
1457
1429
                                     'propedit', propname)
1458
 
  svntest.actions.run_and_verify_svn(None, None, expected_stderr,
 
1430
  svntest.actions.run_and_verify_svn(None, expected_stderr,
1459
1431
                                     'propget', propname)
1460
 
  svntest.actions.run_and_verify_svn(None, None, expected_stderr,
 
1432
  svntest.actions.run_and_verify_svn(None, expected_stderr,
1461
1433
                                     'propset', propname, propval)
1462
1434
 
1463
 
  svntest.actions.run_and_verify_svn(None, None, expected_stderr,
 
1435
  svntest.actions.run_and_verify_svn(None, expected_stderr,
1464
1436
                                     'commit', '--with-revprop',
1465
1437
                                     '='.join([propname, propval]))
1466
1438
  # Now swap them: --with-revprop should accept propname as a property
1467
1439
  # value; no concept of validity there.
1468
 
  svntest.actions.run_and_verify_svn(None, [], [],
 
1440
  svntest.actions.run_and_verify_svn([], [],
1469
1441
                                     'commit', '--with-revprop',
1470
1442
                                     '='.join([propval, propname]))
1471
1443
 
1486
1458
  saved_cwd = os.getcwd()
1487
1459
  os.chdir(sbox.wc_dir)
1488
1460
  try:
1489
 
    svntest.actions.run_and_verify_svn(None, None, [], 'mkdir', 'newdir')
 
1461
    svntest.actions.run_and_verify_svn(None, [], 'mkdir', 'newdir')
1490
1462
    os.symlink('newdir', 'symlink')
1491
 
    svntest.actions.run_and_verify_svn(None, None, [], 'add', 'symlink')
 
1463
    svntest.actions.run_and_verify_svn(None, [], 'add', 'symlink')
1492
1464
    old_mode = os.stat('newdir')[stat.ST_MODE]
1493
1465
    # The only property on 'symlink' is svn:special, so attempting to remove
1494
1466
    # 'svn:executable' should result in an error
1495
1467
    expected_stdout = (".*Attempting to delete nonexistent property "
1496
1468
                       "'svn:executable'.*")
1497
 
    svntest.actions.run_and_verify_svn(None, expected_stdout, [], 'propdel',
 
1469
    svntest.actions.run_and_verify_svn(expected_stdout, [], 'propdel',
1498
1470
                                     'svn:executable', 'symlink')
1499
1471
    new_mode = os.stat('newdir')[stat.ST_MODE]
1500
1472
    if not old_mode == new_mode:
1535
1507
 
1536
1508
  # Commit the one file.
1537
1509
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
1538
 
                                        expected_status,
1539
 
                                        None, wc_dir)
 
1510
                                        expected_status)
1540
1511
 
1541
1512
  # Create expected trees for the update.
1542
1513
  expected_output = svntest.wc.State(wc_backup, {
1551
1522
                                        expected_output,
1552
1523
                                        expected_disk,
1553
1524
                                        expected_status,
1554
 
                                        None, None, None, None, None, 1)
 
1525
                                        check_props=True)
1555
1526
 
1556
1527
def props_over_time(sbox):
1557
1528
  "property retrieval with peg and operative revs"
1606
1577
        pget_expected = expected
1607
1578
        if pget_expected:
1608
1579
          pget_expected = [ pget_expected + "\n" ]
 
1580
        expected_err = [] if expected else '.*W200017: Property.*not found.*'
1609
1581
        if op_rev != 0:
1610
 
          svntest.actions.run_and_verify_svn(None, pget_expected, [],
 
1582
          svntest.actions.run_and_verify_svn(pget_expected, expected_err,
1611
1583
                                             'propget', 'revision', peg_path,
1612
1584
                                             '-r', str(op_rev))
1613
1585
        else:
1614
 
          svntest.actions.run_and_verify_svn(None, pget_expected, [],
 
1586
          svntest.actions.run_and_verify_svn(pget_expected, expected_err,
1615
1587
                                             'propget', 'revision', peg_path)
1616
1588
 
1617
1589
        ### Test 'svn proplist -v'
1624
1596
                             "    " + expected + "\n" ]
1625
1597
 
1626
1598
        if op_rev != 0:
1627
 
          svntest.actions.run_and_verify_svn(None, plist_expected, [],
 
1599
          svntest.actions.run_and_verify_svn(plist_expected, [],
1628
1600
                                             'proplist', '-v', peg_path,
1629
1601
                                             '-r', str(op_rev))
1630
1602
        else:
1631
 
          svntest.actions.run_and_verify_svn(None, plist_expected, [],
 
1603
          svntest.actions.run_and_verify_svn(plist_expected, [],
1632
1604
                                             'proplist', '-v', peg_path)
1633
1605
 
1634
1606
 
1635
1607
# XFail the same reason revprop_change() is.
1636
1608
@SkipUnless(svntest.main.server_enforces_date_syntax)
1637
 
@XFail(svntest.main.is_ra_type_dav)
1638
1609
@Issue(3086)
1639
1610
def invalid_propvalues(sbox):
1640
1611
  "test handling invalid svn:* property values"
1646
1617
  svntest.actions.enable_revprop_changes(repo_dir)
1647
1618
 
1648
1619
  expected_stderr = '.*unexpected property value.*|.*Bogus date.*'
1649
 
  svntest.actions.run_and_verify_svn(None, [], expected_stderr,
 
1620
  svntest.actions.run_and_verify_svn([], expected_stderr,
1650
1621
                                     'propset', '--revprop', '-r', '0',
1651
1622
                                     'svn:date', 'Sat May 10 12:12:31 2008',
1652
1623
                                     repo_url)
1678
1649
  expected_out = [ "Properties on '" + foo_url + "':\n",
1679
1650
                   "  someprop\n",
1680
1651
                   "    someval\n" ]
1681
 
  svntest.actions.run_and_verify_svn(None, expected_out, [],
 
1652
  svntest.actions.run_and_verify_svn(expected_out, [],
1682
1653
                                     'proplist', '-v', foo_url)
1683
1654
 
1684
1655
def added_moved_file(sbox):
1720
1691
 
1721
1692
  # Remove one property
1722
1693
  expected_stdout = ".*Attempting to delete nonexistent property 'yellow'.*"
1723
 
  svntest.actions.run_and_verify_svn(None, expected_stdout, [],
 
1694
  svntest.actions.run_and_verify_svn(expected_stdout, [],
1724
1695
                                     'propdel', 'yellow',
1725
1696
                                     os.path.join(wc_dir, 'A', 'D', 'G'))
1726
1697
 
1740
1711
  svntest.actions.create_failing_hook(repo_dir, 'post-revprop-change',
1741
1712
                                      error_msg)
1742
1713
 
1743
 
  # serf/neon/mod_dav_svn give SVN_ERR_RA_DAV_REQUEST_FAILED
 
1714
  # serf/mod_dav_svn give SVN_ERR_RA_DAV_PROPPATCH_FAILED
1744
1715
  # file/svn give SVN_ERR_REPOS_HOOK_FAILURE
1745
 
  expected_error = 'svn: (E175002|E165001).*post-revprop-change hook failed'
 
1716
  expected_error = 'svn: (E175008|E165001).*post-revprop-change hook failed'
1746
1717
 
1747
 
  svntest.actions.run_and_verify_svn(None, [], expected_error,
 
1718
  svntest.actions.run_and_verify_svn([], expected_error,
1748
1719
                                     'ps', '--revprop', '-r0', 'p', 'v',
1749
1720
                                     wc_dir)
1750
1721
 
1751
1722
  # Verify change has stuck -- at one time mod_dav_svn would rollback
1752
1723
  # revprop changes on post-revprop-change hook errors
1753
 
  svntest.actions.run_and_verify_svn(None, 'v', [],
 
1724
  svntest.actions.run_and_verify_svn('v', [],
1754
1725
                                     'pg', '--revprop', '-r0', 'p',
1755
1726
                                     wc_dir)
1756
1727
 
1786
1757
  svntest.main.run_svn(None, 'rm', '--force', mu_path)
1787
1758
 
1788
1759
  svntest.actions.run_and_verify_svn(
1789
 
                        None, [],
 
1760
                        [],
1790
1761
                        'svn: E200009.*some targets are not versioned.*',
1791
1762
                        'proplist', '-v', mu_path)
1792
1763
 
1884
1855
    "Trying to change property 'edit.none'\n"
1885
1856
    "but the property does not exist locally.\n"
1886
1857
    "<<<<<<< (local property value)\n"
1887
 
    "=======\n"
1888
 
    "repos.changed>>>>>>> (incoming property value)\n",
 
1858
    "||||||| (incoming 'changed from' value)\n"
 
1859
    "repos=======\n"
 
1860
    "repos.changed>>>>>>> (incoming 'changed to' value)\n",
1889
1861
 
1890
1862
    "Trying to delete property 'del.del'\n"
1891
1863
    "but the property has been locally deleted and had a different value.\n",
1893
1865
    "Trying to delete property 'del.edit'\n"
1894
1866
    "but the local property value is different.\n"
1895
1867
    "<<<<<<< (local property value)\n"
1896
 
    "local.changed=======\n"
1897
 
    ">>>>>>> (incoming property value)\n",
 
1868
    "local.changed||||||| (incoming 'changed from' value)\n"
 
1869
    "repos=======\n"
 
1870
    ">>>>>>> (incoming 'changed to' value)\n",
1898
1871
 
1899
1872
    "Trying to change property 'edit.del'\n"
1900
1873
    "but the property has been locally deleted.\n"
1901
1874
    "<<<<<<< (local property value)\n"
1902
 
    "=======\n"
1903
 
    "repos.changed>>>>>>> (incoming property value)\n",
 
1875
    "||||||| (incoming 'changed from' value)\n"
 
1876
    "repos=======\n"
 
1877
    "repos.changed>>>>>>> (incoming 'changed to' value)\n",
1904
1878
 
1905
1879
    "Trying to change property 'edit.edit'\n"
1906
1880
    "but the property has already been locally changed to a different value.\n"
1907
1881
    "<<<<<<< (local property value)\n"
1908
 
    "local.changed=======\n"
1909
 
    "repos.changed>>>>>>> (incoming property value)\n",
 
1882
    "local.changed||||||| (incoming 'changed from' value)\n"
 
1883
    "repos=======\n"
 
1884
    "repos.changed>>>>>>> (incoming 'changed to' value)\n",
1910
1885
 
1911
1886
    "Trying to delete property 'del.edit2'\n"
1912
1887
    "but the property has been locally modified.\n"
1913
1888
    "<<<<<<< (local property value)\n"
1914
 
    "repos.changed=======\n"
1915
 
    ">>>>>>> (incoming property value)\n",
 
1889
    "repos.changed||||||| (incoming 'changed from' value)\n"
 
1890
    "repos=======\n"
 
1891
    ">>>>>>> (incoming 'changed to' value)\n",
1916
1892
 
1917
1893
    "Trying to delete property 'del.add'\n"
1918
1894
    "but the property has been locally added.\n"
1919
1895
    "<<<<<<< (local property value)\n"
1920
 
    "local=======\n"
1921
 
    ">>>>>>> (incoming property value)\n",
 
1896
    "local||||||| (incoming 'changed from' value)\n"
 
1897
    "repos=======\n"
 
1898
    ">>>>>>> (incoming 'changed to' value)\n",
1922
1899
 
1923
1900
    "Trying to delete property 'del.diff'\n"
1924
1901
    "but the local property value is different.\n"
1925
1902
    "<<<<<<< (local property value)\n"
1926
 
    "local=======\n"
1927
 
    ">>>>>>> (incoming property value)\n",
 
1903
    "local||||||| (incoming 'changed from' value)\n"
 
1904
    "repos=======\n"
 
1905
    ">>>>>>> (incoming 'changed to' value)\n",
1928
1906
 
1929
1907
    "Trying to change property 'edit.add'\n"
1930
1908
    "but the property has been locally added with a different value.\n"
1931
1909
    "<<<<<<< (local property value)\n"
1932
 
    "local=======\n"
1933
 
    "repos.changed>>>>>>> (incoming property value)\n",
 
1910
    "local||||||| (incoming 'changed from' value)\n"
 
1911
    "repos=======\n"
 
1912
    "repos.changed>>>>>>> (incoming 'changed to' value)\n",
1934
1913
 
1935
1914
    "Trying to change property 'edit.diff'\n"
1936
1915
    "but the local property value conflicts with the incoming change.\n"
1937
1916
    "<<<<<<< (local property value)\n"
1938
 
    "local=======\n"
1939
 
    "repos.changed>>>>>>> (incoming property value)\n",
 
1917
    "local||||||| (incoming 'changed from' value)\n"
 
1918
    "repos=======\n"
 
1919
    "repos.changed>>>>>>> (incoming 'changed to' value)\n",
1940
1920
 
1941
1921
    "Trying to add new property 'add.add'\n"
1942
1922
    "but the property already exists.\n"
1943
1923
    "<<<<<<< (local property value)\n"
1944
 
    "local=======\n"
1945
 
    "repos>>>>>>> (incoming property value)\n",
 
1924
    "local||||||| (incoming 'changed from' value)\n"
 
1925
    "=======\n"
 
1926
    "repos>>>>>>> (incoming 'changed to' value)\n",
1946
1927
 
1947
1928
    "Trying to add new property 'add.diff'\n"
1948
1929
    "but the property already exists.\n"
1949
 
    "Local property value:\n"
1950
 
    "local\n"
 
1930
    "<<<<<<< (local property value)\n"
 
1931
    "local||||||| (incoming 'changed from' value)\n"
 
1932
    "=======\n"
 
1933
    "repos>>>>>>> (incoming 'changed to' value)\n",
 
1934
 
 
1935
    "Trying to add new property 'add.del'\n"
 
1936
    "but the property has been locally deleted.\n"
1951
1937
    "Incoming property value:\n"
1952
1938
    "repos\n",
1953
1939
 
1954
 
    "Trying to add new property 'add.del'\n"
1955
 
    "but the property has been locally deleted.\n"
1956
 
    "<<<<<<< (local property value)\n"
1957
 
    "=======\n"
1958
 
    "repos>>>>>>> (incoming property value)\n",
1959
 
 
1960
1940
    "Trying to add new property 'add.edit'\n"
1961
1941
    "but the property already exists.\n"
1962
1942
    "<<<<<<< (local property value)\n"
1963
 
    "local.changed=======\n"
1964
 
    "repos>>>>>>> (incoming property value)\n",
 
1943
    "local.changed||||||| (incoming 'changed from' value)\n"
 
1944
    "=======\n"
 
1945
    "repos>>>>>>> (incoming 'changed to' value)\n",
1965
1946
  ]
1966
1947
 
1967
1948
  # Get the contents of mu.prej.  The error messages are in the prej file
2048
2029
 
2049
2030
  # Initial state.
2050
2031
  svntest.actions.enable_revprop_changes(sbox.repo_dir)
2051
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
2032
  svntest.actions.run_and_verify_svn(None, [],
2052
2033
                                     'propset', '--revprop', '-r', '0',
2053
2034
                                     'flower', s1, repo_url)
2054
2035
 
2059
2040
    # so we should fail.
2060
2041
    expected_stderr = ".*doesn't advertise.*ATOMIC_REVPROP"
2061
2042
    svntest.actions.run_and_verify_atomic_ra_revprop_change(
2062
 
       None, None, expected_stderr, 1, repo_url, 0, 'flower',
2063
 
       old_value, proposed_value)
 
2043
       None, expected_stderr, 1, repo_url, 0, 'flower',
 
2044
       old_value, proposed_value, True)
2064
2045
 
2065
2046
    # The original value is still there.
2066
2047
    svntest.actions.check_prop('flower', repo_url, [s1], 0)
2068
2049
  def FAILS_WITH_BPV(not_the_old_value, proposed_value):
2069
2050
    if svntest.main.server_has_atomic_revprop():
2070
2051
      svntest.actions.run_and_verify_atomic_ra_revprop_change(
2071
 
         None, None, [], 0, repo_url, 0, 'flower',
 
2052
         None, [], 0, repo_url, 0, 'flower',
2072
2053
         not_the_old_value, proposed_value, True)
2073
2054
    else:
2074
2055
      expect_old_server_fail(not_the_old_value, proposed_value)
2076
2057
  def PASSES_WITHOUT_BPV(yes_the_old_value, proposed_value):
2077
2058
    if svntest.main.server_has_atomic_revprop():
2078
2059
      svntest.actions.run_and_verify_atomic_ra_revprop_change(
2079
 
         None, None, [], 0, repo_url, 0, 'flower',
 
2060
         None, [], 0, repo_url, 0, 'flower',
2080
2061
         yes_the_old_value, proposed_value, False)
2081
2062
    else:
2082
2063
      expect_old_server_fail(yes_the_old_value, proposed_value)
2247
2228
  # Set the 'big' mergeinfo prop on A/B, A/C, and A/D.
2248
2229
  svntest.main.file_write(prop_val_file, big_prop_val)
2249
2230
 
2250
 
  svntest.actions.run_and_verify_svn(None, None, [], 'propset',
 
2231
  svntest.actions.run_and_verify_svn(None, [], 'propset',
2251
2232
                                     SVN_PROP_MERGEINFO, '-F', prop_val_file,
2252
2233
                                     B_path)
2253
 
  svntest.actions.run_and_verify_svn(None, None, [], 'propset',
 
2234
  svntest.actions.run_and_verify_svn(None, [], 'propset',
2254
2235
                                     SVN_PROP_MERGEINFO, '-F', prop_val_file,
2255
2236
                                     C_path)
2256
 
  svntest.actions.run_and_verify_svn(None, None, [], 'propset',
 
2237
  svntest.actions.run_and_verify_svn(None, [], 'propset',
2257
2238
                                     SVN_PROP_MERGEINFO, '-F', prop_val_file,
2258
2239
                                     D_path)
2259
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
 
2240
  svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
2260
2241
                                     'ps some large svn:mergeinfos', wc_dir)
2261
2242
 
2262
2243
  # Run propget -vR svn:mergeinfo, redirecting the stdout to a file.
2300
2281
 
2301
2282
  # Add file with awkward name
2302
2283
  svntest.main.file_append(sbox.ospath('A/dir_conflicts'), "some content\n")
2303
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
2284
  svntest.actions.run_and_verify_svn(None, [],
2304
2285
                                     'add', sbox.ospath('A/dir_conflicts'))
2305
2286
  sbox.simple_propset('prop', 'val1', 'A/dir_conflicts')
2306
2287
  sbox.simple_propset('prop', 'val1', 'A')
2314
2295
    'A/dir_conflicts' : Item(status='  ', wc_rev=2),
2315
2296
      })
2316
2297
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
2317
 
                                        expected_status, None, wc_dir)
 
2298
                                        expected_status)
2318
2299
 
2319
2300
  # Modify/commit property change
2320
2301
  sbox.simple_propset('prop', 'val2', 'A/dir_conflicts')
2325
2306
      })
2326
2307
  expected_status.tweak('A', 'A/dir_conflicts', wc_rev=3)
2327
2308
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
2328
 
                                        expected_status, None, wc_dir)
 
2309
                                        expected_status)
2329
2310
 
2330
2311
  # Local property mod
2331
2312
  sbox.simple_propset('prop', 'val3', 'A/dir_conflicts')
2344
2325
  expected_status.tweak(wc_rev=2)
2345
2326
  expected_status.tweak('A', 'A/dir_conflicts', status=' C')
2346
2327
 
 
2328
  # Conflict: BASE=val2 WORKING=val3 INCOMING_OLD=val2 INCOMING_NEW=val1
2347
2329
  extra_files = ['dir_conflicts.prej', 'dir_conflicts.2.prej']
2348
2330
  svntest.actions.run_and_verify_update(wc_dir,
2349
2331
                                        expected_output,
2350
2332
                                        expected_disk,
2351
2333
                                        expected_status,
2352
 
                                        None,
2353
 
                                        svntest.tree.detect_conflict_files,
2354
 
                                        extra_files,
2355
 
                                        None, None, True, '-r', '2', wc_dir)
2356
 
  if len(extra_files) != 0:
2357
 
    logger.warn("didn't get expected conflict files")
2358
 
    raise svntest.verify.SVNUnexpectedOutput
 
2334
                                        [], True,
 
2335
                                        '-r', '2', wc_dir,
 
2336
                                        extra_files=extra_files)
2359
2337
 
2360
2338
  # Revert and update to check that conflict files are removed
2361
 
  svntest.actions.run_and_verify_svn(None, None, [], 'revert', '-R', wc_dir)
 
2339
  svntest.actions.run_and_verify_svn(None, [], 'revert', '-R', wc_dir)
2362
2340
  expected_status.tweak('A', 'A/dir_conflicts', status='  ')
2363
2341
  svntest.actions.run_and_verify_status(wc_dir, expected_status)
2364
2342
 
2372
2350
                                        expected_output,
2373
2351
                                        expected_disk,
2374
2352
                                        expected_status,
2375
 
                                        None, None, None, None, None, True)
 
2353
                                        check_props=True)
2376
2354
 
2377
2355
def pristine_props_listed(sbox):
2378
2356
  "check if pristine properties are visible"
2386
2364
  expected_output = ["Properties on '" + sbox.ospath('A') + "':\n", "  prop\n"]
2387
2365
 
2388
2366
  # Now we see the pristine properties
2389
 
  svntest.actions.run_and_verify_svn(None, expected_output, [],
 
2367
  svntest.actions.run_and_verify_svn(expected_output, [],
2390
2368
                                     'proplist', '-R', wc_dir, '-r', 'BASE')
2391
2369
 
2392
2370
  sbox.simple_propset('prop', 'needs-fix', 'A')
2393
2371
 
2394
2372
  # And now we see no property at all
2395
 
  svntest.actions.run_and_verify_svn(None, expected_output, [],
 
2373
  svntest.actions.run_and_verify_svn(expected_output, [],
2396
2374
                                     'proplist', '-R', wc_dir, '-r', 'BASE')
2397
2375
 
2398
2376
def create_inherited_ignores_config(config_dir):
2470
2448
    ['?       ' + X_dir_path + '\n',
2471
2449
     '?       ' + Y_dir_path + '\n',
2472
2450
     '?       ' + Z_dir_path + '\n',])
2473
 
  svntest.actions.run_and_verify_svn(None, expected_output, [], 'st',
 
2451
  svntest.actions.run_and_verify_svn(expected_output, [], 'st',
2474
2452
                                     '--config-dir', config_dir, wc_dir)
2475
2453
 
2476
2454
  # Check status without the custom config.
2482
2460
     '?       ' + Z_dir_path    + '\n',
2483
2461
     '?       ' + boo_dir_path  + '\n',
2484
2462
     '?       ' + goo_file_path + '\n',])
2485
 
  svntest.actions.run_and_verify_svn(None, expected_output, [], 'st', wc_dir)
 
2463
  svntest.actions.run_and_verify_svn(expected_output, [], 'st', wc_dir)
2486
2464
 
2487
2465
  # Check status with the custom config and --no-ignore.
2488
2466
  expected_output = svntest.verify.UnorderedOutput(
2497
2475
     'I       ' + goo_file_path  + '\n',
2498
2476
     'I       ' + moo_file_path  + '\n',
2499
2477
     'I       ' + foo_file_path  + '\n',])
2500
 
  svntest.actions.run_and_verify_svn(None, expected_output, [], 'st',
 
2478
  svntest.actions.run_and_verify_svn(expected_output, [], 'st',
2501
2479
                                     '--config-dir', config_dir,
2502
2480
                                     '--no-ignore', wc_dir)
2503
2481
 
2516
2494
     '?       ' + goo_file_path  + '\n',
2517
2495
     'I       ' + moo_file_path  + '\n',
2518
2496
     'I       ' + foo_file_path  + '\n',])
2519
 
  svntest.actions.run_and_verify_svn(None, expected_output, [], 'st',
 
2497
  svntest.actions.run_and_verify_svn(expected_output, [], 'st',
2520
2498
                                     '--no-ignore', wc_dir)
2521
2499
 
2522
2500
  # Perform the add with the --force flag, targeting the root of the WC.
2531
2509
    ['A         ' + 'ADD-ME-DIR-X\n',
2532
2510
     'A         ' + os.path.join('A', 'ADD-ME-DIR-Y.doo') + '\n',
2533
2511
     'A         ' + os.path.join('A', 'D', 'G', 'ADD-ME-DIR-Z.doo') + '\n'])
2534
 
  svntest.actions.run_and_verify_svn("Adds in spite of ignores", expected,
 
2512
  svntest.actions.run_and_verify_svn(expected,
2535
2513
                                     [], 'add', '.', '--force',
2536
2514
                                     '--config-dir', config_dir)
2537
2515
  os.chdir(saved_wd)
2538
2516
 
2539
2517
  # Now revert and try the add with the --no-ignore flag, nothing should
2540
2518
  # be ignored.
2541
 
  svntest.actions.run_and_verify_svn(None, None, [], 'revert', wc_dir, '-R')
 
2519
  svntest.actions.run_and_verify_svn(None, [], 'revert', wc_dir, '-R')
2542
2520
  saved_wd = os.getcwd()
2543
2521
  os.chdir(sbox.wc_dir)
2544
2522
  expected = svntest.verify.UnorderedOutput(
2561
2539
                                 'ignore-me-file.roo') + '\n',
2562
2540
     'A         ' + os.path.join('A', 'D', 'IGNORE-ME-DIR.moo') + '\n',
2563
2541
     'A         ' + os.path.join('A', 'D', 'ignore-me-file.moo') + '\n'])
2564
 
  svntest.actions.run_and_verify_svn("Files ignored with --no-ignore",
2565
 
                                     expected, [], 'add', '.', '--force',
 
2542
  svntest.actions.run_and_verify_svn(expected, [], 'add', '.', '--force',
2566
2543
                                     '--no-ignore', '--config-dir',
2567
2544
                                     config_dir)
2568
2545
 
2595
2572
  svntest.actions.set_prop('svn:foobar', 'x', iota_path,
2596
2573
                           "svn: E195011: 'svn:foobar'"
2597
2574
                           " is not a valid svn: property name;"
2598
 
                           " re-run with '--force' to set it")
 
2575
                           " use '--force' to set it")
2599
2576
 
2600
2577
@Issue(3231)
2601
2578
def peg_rev_base_working(sbox):
2608
2585
  svntest.actions.set_prop('ordinal', 'ninth\n', sbox.ospath('iota'))
2609
2586
  sbox.simple_commit(message='r2')
2610
2587
  svntest.actions.set_prop('cardinal', 'nine\n', sbox.ospath('iota'))
2611
 
  svntest.actions.run_and_verify_svn(None, ['ninth\n'], [],
2612
 
                                     'propget', '--strict', 'ordinal',
 
2588
  svntest.actions.run_and_verify_svn(['ninth\n'], [],
 
2589
                                     'propget', '--no-newline', 'ordinal',
2613
2590
                                     sbox.ospath('iota') + '@BASE')
2614
2591
 
 
2592
@Issue(4415)
 
2593
def xml_unsafe_author(sbox):
 
2594
  "svn:author with XML unsafe chars"
 
2595
 
 
2596
  sbox.build()
 
2597
  wc_dir = sbox.wc_dir
 
2598
 
 
2599
  svntest.actions.enable_revprop_changes(sbox.repo_dir)
 
2600
 
 
2601
  # client sends svn:author (via PROPPATCH for DAV)
 
2602
  svntest.actions.run_and_verify_svn(None, [],
 
2603
                                     'propset', '--revprop', '-r', '1',
 
2604
                                     'svn:author', 'foo\bbar', wc_dir)
 
2605
 
 
2606
  # mod_dav_svn sends svn:author (via REPORT for DAV)
 
2607
  sbox.simple_update(revision=0)
 
2608
  sbox.simple_update(revision=1)
 
2609
  expected_info = [{
 
2610
      'Path' : re.escape(wc_dir),
 
2611
      'Repository Root' : sbox.repo_url,
 
2612
      'Repository UUID' : svntest.actions.get_wc_uuid(wc_dir),
 
2613
      'Last Changed Author' : 'foo\bbar',
 
2614
  }]
 
2615
  svntest.actions.run_and_verify_info(expected_info, wc_dir)
 
2616
 
 
2617
  # mod_dav_svn sends svn:author (via PROPFIND for DAV)
 
2618
  # Since r1553367 this works correctly on ra_serf, since we now request
 
2619
  # a single property value which skips creating the creator-displayname property
 
2620
  svntest.actions.run_and_verify_svn(['foo\bbar'], [],
 
2621
                                     'propget', '--revprop', '-r', '1',
 
2622
                                     'svn:author', '--no-newline', wc_dir)
 
2623
 
 
2624
  # Ensure a stable date
 
2625
  svntest.actions.run_and_verify_svn(None, [],
 
2626
                                     'propset', '--revprop', '-r', '1',
 
2627
                                     'svn:date', '2015-01-01T00:00:00.0Z', wc_dir)
 
2628
 
 
2629
  # But a proplist of this property value still fails via DAV.
 
2630
  expected_output = svntest.verify.UnorderedOutput([
 
2631
    'Unversioned properties on revision 1:\n',
 
2632
    '  svn:author\n',
 
2633
    '    foo\bbar\n',
 
2634
    '  svn:date\n',
 
2635
    '    2015-01-01T00:00:00.0Z\n',
 
2636
    '  svn:log\n',
 
2637
    '    Log message for revision 1.\n'
 
2638
  ])
 
2639
  svntest.actions.run_and_verify_svn(expected_output, [],
 
2640
                                     'proplist', '--revprop', '-r', '1', '-v',
 
2641
                                     wc_dir)
 
2642
 
 
2643
@Issue(4415)
 
2644
def xml_unsafe_author2(sbox):
 
2645
  "svn:author with XML unsafe chars 2"
 
2646
 
 
2647
  sbox.build(create_wc = False)
 
2648
  repo_url = sbox.repo_url
 
2649
 
 
2650
  svntest.actions.enable_revprop_changes(sbox.repo_dir)
 
2651
 
 
2652
  # client sends svn:author (via PROPPATCH for DAV)
 
2653
  svntest.actions.run_and_verify_svn(None, [],
 
2654
                                     'propset', '--revprop', '-r', '1',
 
2655
                                     'svn:author', 'foo\bbar', repo_url)
 
2656
 
 
2657
  # Ensure a stable date
 
2658
  svntest.actions.run_and_verify_svn(None, [],
 
2659
                                     'propset', '--revprop', '-r', '1',
 
2660
                                     'svn:date', '2000-01-01T12:00:00.0Z',
 
2661
                                     repo_url)
 
2662
 
 
2663
  if svntest.main.is_ra_type_dav():
 
2664
    # This receives the filtered author (but that is better than an Xml fail)
 
2665
    expected_author = 'foobar'
 
2666
  else:
 
2667
    expected_author = 'foo\bbar'
 
2668
 
 
2669
  # Use svn ls in --xml mode to test locale independent output.
 
2670
  expected_output = [
 
2671
    '<?xml version="1.0" encoding="UTF-8"?>\n',
 
2672
    '<lists>\n',
 
2673
    '<list\n',
 
2674
    '   path="%s">\n' % sbox.repo_url,
 
2675
    '<entry\n',
 
2676
    '   kind="dir">\n',
 
2677
    '<name>A</name>\n',
 
2678
    '<commit\n',
 
2679
    '   revision="1">\n',
 
2680
    '<author>%s</author>\n' % expected_author,
 
2681
    '<date>2000-01-01T12:00:00.000000Z</date>\n',
 
2682
    '</commit>\n',
 
2683
    '</entry>\n',
 
2684
    '<entry\n',
 
2685
    '   kind="file">\n',
 
2686
    '<name>iota</name>\n',
 
2687
    '<size>25</size>\n',
 
2688
    '<commit\n',
 
2689
    '   revision="1">\n',
 
2690
    '<author>%s</author>\n' % expected_author,
 
2691
    '<date>2000-01-01T12:00:00.000000Z</date>\n',
 
2692
    '</commit>\n',
 
2693
    '</entry>\n',
 
2694
    '</list>\n',
 
2695
    '</lists>\n'
 
2696
    ]
 
2697
 
 
2698
  svntest.actions.run_and_verify_svn(expected_output, [],
 
2699
                                     'ls', '--xml', repo_url)
 
2700
 
 
2701
  expected_info = [{
 
2702
      'Repository Root' : sbox.repo_url,
 
2703
      'Last Changed Author' : expected_author,
 
2704
  }]
 
2705
  svntest.actions.run_and_verify_info(expected_info, repo_url)
 
2706
 
 
2707
def dir_prop_conflict_details(sbox):
 
2708
  "verify dir property conflict details"
 
2709
 
 
2710
  sbox.build()
 
2711
  wc_dir = sbox.wc_dir
 
2712
 
 
2713
  # Apply some changes
 
2714
  sbox.simple_propset('svn:mergeinfo', '/B:1', 'A')
 
2715
  sbox.simple_propset('my-prop', 'my-val', 'A')
 
2716
  sbox.simple_commit()
 
2717
 
 
2718
  # Revert to r1
 
2719
  sbox.simple_update('', revision=1)
 
2720
 
 
2721
  # Apply some incompatible changes
 
2722
  sbox.simple_propset('svn:mergeinfo', '/C:1', 'A')
 
2723
  sbox.simple_propset('my-prop', 'other-val', 'A')
 
2724
 
 
2725
  # This should report out of date because there are incompatible property
 
2726
  # changes that can't be merged on the server
 
2727
  svntest.actions.run_and_verify_commit(wc_dir,
 
2728
                                        None,
 
2729
                                        None,
 
2730
                                        '.*[Oo]ut of date.*')
 
2731
 
 
2732
  expected_output = svntest.wc.State(wc_dir, {
 
2733
    'A'                 : Item(status=' C'),
 
2734
  })
 
2735
  expected_status = svntest.actions.get_virginal_state(wc_dir, 2)
 
2736
  expected_status.tweak('A', status=' C')
 
2737
 
 
2738
  svntest.actions.run_and_verify_update(wc_dir,
 
2739
                                        expected_output,
 
2740
                                        None,
 
2741
                                        expected_status,
 
2742
                                        check_props=True)
 
2743
 
 
2744
  # The conflict properties file line was shown for previous versions, but the
 
2745
  # conflict source urls are new since 1.8.
 
2746
  expected_info = {
 
2747
    'Conflict Properties File' : re.escape(sbox.ospath('A/dir_conflicts.prej')),
 
2748
    'Conflict Details': re.escape('incoming dir edit upon update'
 
2749
                                           + ' Source  left: (dir) ^/A@1'
 
2750
                                           + ' Source right: (dir) ^/A@2')
 
2751
  }
 
2752
  svntest.actions.run_and_verify_info([expected_info], sbox.path('A'))
 
2753
 
 
2754
 
2615
2755
def iprops_list_abspath(sbox):
2616
2756
  "test listing iprops via abspath"
2617
2757
 
2620
2760
  sbox.simple_propset('im', 'root', '')
2621
2761
  sbox.simple_commit()
2622
2762
 
2623
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
2763
  svntest.actions.run_and_verify_svn(None, [],
2624
2764
                                     'switch', '^/A/D', sbox.ospath(''),
2625
2765
                                     '--ignore-ancestry')
2626
2766
 
2627
2767
  sbox.simple_propset('im', 'GammA', 'gamma')
2628
2768
 
2629
2769
  expected_output = [
2630
 
    'Inherited properties on \'%s\',\n' % sbox.ospath('')[:-1],
 
2770
    'Inherited properties on \'%s\',\n' % sbox.ospath(''),
2631
2771
    'from \'%s\':\n' % sbox.repo_url,
2632
2772
    '  im\n',
2633
2773
    '    root\n',
2635
2775
    '  im\n',
2636
2776
    '    GammA\n'
2637
2777
  ]
2638
 
  svntest.actions.run_and_verify_svn(None, expected_output, [],
 
2778
  svntest.actions.run_and_verify_svn(expected_output, [],
2639
2779
                                     'pl', '-R',
2640
2780
                                     '--show-inherited-props', '-v',
2641
2781
                                     sbox.ospath(''))
2649
2789
    '  im\n',
2650
2790
    '    GammA\n'
2651
2791
  ]
2652
 
  svntest.actions.run_and_verify_svn(None, expected_output, [],
 
2792
  svntest.actions.run_and_verify_svn(expected_output, [],
2653
2793
                                     'pl', '-R',
2654
2794
                                     '--show-inherited-props', '-v',
2655
2795
                                     os.path.abspath(sbox.ospath('')))
2659
2799
 
2660
2800
  sbox.build(create_wc = False)
2661
2801
 
2662
 
  svntest.actions.run_and_verify_svn(None, None, '.*E195000:.*path',
 
2802
  svntest.actions.run_and_verify_svn(None, '.*E195000:.*path',
2663
2803
                                     'pl', '-r', 'PREV',
2664
2804
                                     sbox.repo_url)
2665
2805
 
2666
 
  svntest.actions.run_and_verify_svn(None, None, '.*E195000:.*path',
 
2806
  svntest.actions.run_and_verify_svn(None, '.*E195000:.*path',
2667
2807
                                     'pg', 'my:Q', '-r', 'PREV',
2668
2808
                                     sbox.repo_url)
2669
2809
 
 
2810
def prop_conflict_root(sbox):
 
2811
  """property conflict on wc root"""
 
2812
 
 
2813
  sbox.build()
 
2814
  wc_dir = sbox.wc_dir
 
2815
 
 
2816
  sbox.simple_propset('propname', 'propval1', '')
 
2817
  sbox.simple_commit()
 
2818
  sbox.simple_propset('propname', 'propval2', '')
 
2819
  sbox.simple_commit()
 
2820
  sbox.simple_update(revision=2)
 
2821
  sbox.simple_propset('propname', 'propvalconflict', '')
 
2822
 
 
2823
  expected_output = svntest.wc.State(wc_dir, {
 
2824
    '' : Item(status=' C'),
 
2825
  })
 
2826
  expected_disk = svntest.main.greek_state.copy()
 
2827
  expected_status = svntest.actions.get_virginal_state(wc_dir, 3)
 
2828
  expected_status.tweak('', status=' C')
 
2829
  extra_files = ['dir_conflicts.prej']
 
2830
  svntest.actions.run_and_verify_update(wc_dir,
 
2831
                                        expected_output,
 
2832
                                        expected_disk,
 
2833
                                        expected_status,
 
2834
                                        extra_files=extra_files)
2670
2835
 
2671
2836
########################################################################
2672
2837
# Run the tests
2713
2878
              inheritable_ignores,
2714
2879
              almost_known_prop_names,
2715
2880
              peg_rev_base_working,
 
2881
              xml_unsafe_author,
 
2882
              xml_unsafe_author2,
 
2883
              dir_prop_conflict_details,
2716
2884
              iprops_list_abspath,
2717
2885
              wc_propop_on_url,
 
2886
              prop_conflict_root,
2718
2887
             ]
2719
2888
 
2720
2889
if __name__ == '__main__':