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

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): James McCoy
  • Date: 2014-05-20 22:45:32 UTC
  • mfrom: (0.2.12)
  • Revision ID: package-import@ubuntu.com-20140520224532-4fec3gohdzyy692g
Tags: 1.8.9-1
* New upstream release
* Merge changes from Ubuntu:
  - Add DEB-8 test for Apache functionality
  - debian/rules: Create pot file on build.
  - debian/rules: Ensure the doxygen output directory exists
  - Move svn2cl to subversion-tools' Suggests on Ubuntu.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2545
2545
                                           'STDERR',
2546
2546
                                           expected_stderr, actual_stderr)
2547
2547
 
 
2548
  # Now list the txns in the repo. The list should be empty.
 
2549
  exit_code, output, errput = svntest.main.run_svnadmin('lstxns',
 
2550
                                                        sbox.repo_dir)
 
2551
  svntest.verify.compare_and_display_lines(
 
2552
    "Error running 'svnadmin lstxns'.",
 
2553
    'STDERR', [], errput)
 
2554
  svntest.verify.compare_and_display_lines(
 
2555
    "Output of 'svnadmin lstxns' is unexpected.",
 
2556
    'STDOUT', [], output)
 
2557
 
2548
2558
#----------------------------------------------------------------------
2549
2559
@Issue(3553)
2550
2560
def pre_commit_hook_test(sbox):
2998
3008
                                        None,
2999
3009
                                        wc_dir)
3000
3010
 
3001
 
  
 
3011
def commit_deep_deleted(sbox):
 
3012
  "try to commit a deep descendant of a deleted node"
 
3013
 
 
3014
  sbox.build()
 
3015
 
 
3016
  sbox.simple_move('A', 'AA')
 
3017
 
 
3018
  sbox.simple_propset('k', 'v', 'AA/D/G')
 
3019
 
 
3020
  # Committing some added descendant returns a proper error
 
3021
  expected_err = ('svn: E200009: \'%s\' is not known to exist in the ' +
 
3022
                  'repository and is not part of the commit, yet its ' +
 
3023
                  'child \'%s\' is part of the commit') % (
 
3024
                    re.escape(os.path.abspath(sbox.ospath('AA'))),
 
3025
                    re.escape(os.path.abspath(sbox.ospath('AA/D/G'))))
 
3026
 
 
3027
  svntest.actions.run_and_verify_commit(sbox.wc_dir,
 
3028
                                        None,
 
3029
                                        None,
 
3030
                                        expected_err,
 
3031
                                        sbox.ospath('AA/D/G'))
 
3032
 
 
3033
  sbox.simple_propdel('k', 'AA/D/G')
 
3034
  sbox.simple_rm('AA/D/G')
 
3035
 
 
3036
  # But a delete fails..
 
3037
  # This used to trigger an assertion in Subversion 1.8.0-1.8.8, because
 
3038
  # the status walker couldn't find the repository path for AA/D/G
 
3039
  svntest.actions.run_and_verify_commit(sbox.wc_dir,
 
3040
                                        None,
 
3041
                                        None,
 
3042
                                        expected_err,
 
3043
                                        sbox.ospath('AA/D/G'))
 
3044
 
 
3045
  # And now commit like how a GUI client would do it, but forgetting the move
 
3046
  expected_err = ('svn: E200009: Cannot commit \'%s\' because it was moved ' +
 
3047
                  'from \'%s\' which is not part of the commit; both sides ' +
 
3048
                  'of the move must be committed together') % (
 
3049
                     re.escape(os.path.abspath(sbox.ospath('AA'))),
 
3050
                     re.escape(os.path.abspath(sbox.ospath('A'))))
 
3051
  svntest.actions.run_and_verify_commit(sbox.wc_dir,
 
3052
                                        None,
 
3053
                                        None,
 
3054
                                        expected_err,
 
3055
                                        '--depth', 'empty',
 
3056
                                        sbox.ospath('AA/D/G'),
 
3057
                                        sbox.ospath('AA'))
 
3058
 
 
3059
 
 
3060
  # And now how it works
 
3061
  svntest.actions.run_and_verify_commit(sbox.wc_dir,
 
3062
                                        None,
 
3063
                                        None,
 
3064
                                        [],
 
3065
                                        '--depth', 'empty',
 
3066
                                        sbox.ospath('AA/D/G'),
 
3067
                                        sbox.ospath('AA'),
 
3068
                                        sbox.ospath('A'))
 
3069
 
 
3070
@Issue(4480)
 
3071
def commit_mergeinfo_ood(sbox):
 
3072
  "commit of mergeinfo that should cause out of date"
 
3073
 
 
3074
  sbox.build()
 
3075
  sbox.simple_rm('A', 'iota')
 
3076
  sbox.simple_commit() # r2
 
3077
 
 
3078
  sbox.simple_mkdir('trunk', 'branch')
 
3079
  sbox.simple_commit() # r3
 
3080
 
 
3081
  sbox.simple_append('trunk/a', 'This is a\n')
 
3082
  sbox.simple_add('trunk/a')
 
3083
  sbox.simple_commit() # r4
 
3084
 
 
3085
  sbox.simple_append('trunk/b', 'This is b\n')
 
3086
  sbox.simple_add('trunk/b')
 
3087
  sbox.simple_commit() # r5
 
3088
 
 
3089
  sbox.simple_update() # To r5
 
3090
 
 
3091
  expected_output = [
 
3092
    '--- Merging r4 into \'%s\':\n' % sbox.ospath('branch'),
 
3093
    'A    %s\n' % sbox.ospath('branch/a'),
 
3094
    '--- Recording mergeinfo for merge of r4' \
 
3095
                                ' into \'%s\':\n' % sbox.ospath('branch'),
 
3096
    ' U   %s\n' % sbox.ospath('branch'),
 
3097
  ]
 
3098
  svntest.actions.run_and_verify_svn(None, expected_output, [],
 
3099
                                     'merge', '-c4', '^/trunk',
 
3100
                                     sbox.ospath('branch'))
 
3101
 
 
3102
  sbox.simple_commit()
 
3103
 
 
3104
  sbox.simple_update(revision='5')
 
3105
 
 
3106
  expected_output = [
 
3107
    '--- Merging r5 into \'%s\':\n' % sbox.ospath('branch'),
 
3108
    'A    %s\n' % sbox.ospath('branch/b'),
 
3109
    '--- Recording mergeinfo for merge of r5 into \'%s\':\n' % sbox.ospath('branch'),
 
3110
    ' U   %s\n' % sbox.ospath('branch'),
 
3111
  ]
 
3112
  svntest.actions.run_and_verify_svn(None, expected_output, [],
 
3113
                                     'merge', '-c5', '^/trunk',
 
3114
                                     sbox.ospath('branch'))
 
3115
 
 
3116
  # Currently this commit succeeds with dav over HTTPv2, while it should really fail
 
3117
  expected_err = '.*out of date.*'
 
3118
  svntest.actions.run_and_verify_svn(None, None, expected_err,
 
3119
                                     'commit', sbox.ospath(''), '-m', 'M')
3002
3120
 
3003
3121
########################################################################
3004
3122
# Run the tests
3072
3190
              commit_danglers,
3073
3191
              last_changed_of_copied_subdir,
3074
3192
              commit_cp_with_deep_delete,
 
3193
              commit_deep_deleted,
 
3194
              commit_mergeinfo_ood,
3075
3195
             ]
3076
3196
 
3077
3197
if __name__ == '__main__':