Alien-SVN

 view release on metacpan or  search on metacpan

src/subversion/subversion/tests/cmdline/switch_tests.py  view on Meta::CPAN

                                        expected_disk,
                                        expected_status,
                                        None, None, None, None, None,
                                        False, '--ignore-ancestry')

#----------------------------------------------------------------------
# Make sure that switch continue after deleting locally modified
# directories, as update and merge do.

@Issue(2505)
def tolerate_local_mods(sbox):
  "tolerate deletion of a directory with local mods"

  sbox.build()
  wc_dir = sbox.wc_dir

  A_path = sbox.ospath('A')
  L_path = os.path.join(A_path, 'L')
  LM_path = os.path.join(L_path, 'local_mod')
  A_url = sbox.repo_url + '/A'
  A2_url = sbox.repo_url + '/A2'

  svntest.actions.run_and_verify_svn(None,
                                     ['\n', 'Committed revision 2.\n'], [],
                                     'cp', '-m', 'make copy', A_url, A2_url)

  os.mkdir(L_path)
  svntest.main.run_svn(None, 'add', L_path)
  svntest.main.run_svn(None, 'ci', '-m', 'Commit added folder', wc_dir)

  # locally modified unversioned file
  svntest.main.file_write(LM_path, 'Locally modified file.\n', 'w+')

  expected_output = svntest.wc.State(wc_dir, {
    'A/L' : Item(status='D '),
    })

  expected_disk = svntest.main.greek_state.copy()
  expected_disk.add({
    'A/L' : Item(),
    'A/L/local_mod' : Item(contents='Locally modified file.\n'),
    })

  expected_status = svntest.actions.get_virginal_state(wc_dir, 3)
  expected_status.tweak('', 'iota', wc_rev=1)
  expected_status.tweak('A', switched='S')

  # Used to fail with locally modified or unversioned files
  svntest.actions.run_and_verify_switch(wc_dir, A_path, A2_url,
                                        expected_output,
                                        expected_disk,
                                        expected_status,
                                        None, None, None, None, None,
                                        False, '--ignore-ancestry')

#----------------------------------------------------------------------

# Detect tree conflicts among files and directories,
# edited or deleted in a deep directory structure.
#
# See use cases 1-3 in notes/tree-conflicts/use-cases.txt for background.
# Note that we do not try to track renames.  The only difference from
# the behavior of Subversion 1.4 and 1.5 is the conflicted status of the
# parent directory.

# convenience definitions
leaf_edit = svntest.deeptrees.deep_trees_leaf_edit
tree_del = svntest.deeptrees.deep_trees_tree_del
leaf_del = svntest.deeptrees.deep_trees_leaf_del

disk_after_leaf_edit = svntest.deeptrees.deep_trees_after_leaf_edit
disk_after_leaf_del = svntest.deeptrees.deep_trees_after_leaf_del
disk_after_tree_del = svntest.deeptrees.deep_trees_after_tree_del

disk_empty_dirs = svntest.deeptrees.deep_trees_empty_dirs

deep_trees_conflict_output = svntest.deeptrees.deep_trees_conflict_output
deep_trees_conflict_output_skipped = \
    svntest.deeptrees.deep_trees_conflict_output_skipped
deep_trees_status_local_tree_del = \
    svntest.deeptrees.deep_trees_status_local_tree_del
deep_trees_status_local_leaf_edit = \
    svntest.deeptrees.deep_trees_status_local_leaf_edit

DeepTreesTestCase = svntest.deeptrees.DeepTreesTestCase

j = os.path.join


def tree_conflicts_on_switch_1_1(sbox):
  "tree conflicts 1.1: tree del, leaf edit on switch"

  sbox.build()

  # use case 1, as in notes/tree-conflicts/use-cases.txt
  # 1.1) local tree delete, incoming leaf edit

  expected_output = deep_trees_conflict_output.copy()
  expected_output.add({
    'DDD/D1/D2'         : Item(status='  ', treeconflict='U'),
    'DDD/D1/D2/D3'      : Item(status='  ', treeconflict='U'),
    'DDD/D1/D2/D3/zeta' : Item(status='  ', treeconflict='A'),
    'DD/D1/D2'          : Item(status='  ', treeconflict='U'),
    'DD/D1/D2/epsilon'  : Item(status='  ', treeconflict='A'),
    'DF/D1/beta'        : Item(status='  ', treeconflict='U'),
    'D/D1/delta'        : Item(status='  ', treeconflict='A'),
    'DDF/D1/D2'         : Item(status='  ', treeconflict='U'),
    'DDF/D1/D2/gamma'   : Item(status='  ', treeconflict='U')
  })

  expected_disk = disk_empty_dirs.copy()
  expected_disk.remove('D/D1', 'DF/D1', 'DD/D1', 'DD/D1/D2',
                       'DDF/D1', 'DDF/D1/D2',
                       'DDD/D1', 'DDD/D1/D2', 'DDD/D1/D2/D3')

  # The files delta, epsilon, and zeta are incoming additions, but since
  # they are all within locally deleted trees they should also be schedule
  # for deletion.
  expected_status = deep_trees_status_local_tree_del.copy()
  expected_status.add({
    'D/D1/delta'        : Item(status='D '),



( run in 1.021 second using v1.01-cache-2.11-cpan-0d23b851a93 )