def svn_commit(self, rpath='', log=''): "Commit a WC path (recursively). Return the new revision number." lpath = local_path(rpath) actions.run_and_verify_svn(None, verify.AnyOutput, [], 'commit', '-m', log, lpath) actions.run_and_verify_update(lpath, None, None, None) self.repo.head_rev += 1 return self.repo.head_rev
def svn_commit(self, rpath='', log=''): "Commit a WC path (recursively). Return the new revision number." lpath = local_path(rpath) actions.run_and_verify_svn(verify.AnyOutput, [], 'commit', '-m', log, lpath) actions.run_and_verify_update(lpath, None, None, None) self.repo.head_rev += 1 return self.repo.head_rev
def svn_update(self, rpath='', rev='HEAD'): "Update the WC to the specified revision" lpath = local_path(rpath) actions.run_and_verify_update(lpath, None, None, None)
def forced_checkout_of_dir_with_file_obstructions(sbox): """forced co flags conflict if a file obstructs a dir""" make_local_tree(sbox, False, False) #svntest.factory.make(sbox,""" # mkdir wc_dir_other # echo "The file A" > wc_dir_other/A # svn co --force url wc_dir_other # """) #svntest.factory.make(sbox,""" # # Now see to it that we can recover from the obstructions. # rm wc_dir_other/A # svn up wc_dir_other""") #exit(0) url = sbox.repo_url wc_dir_other = sbox.add_wc_path('other') other_A = os.path.join(wc_dir_other, 'A') # mkdir wc_dir_other os.makedirs(wc_dir_other) # echo "The file A" > wc_dir_other/A svntest.main.file_write(other_A, 'The file A\n') # svn co --force url wc_dir_other expected_output = svntest.wc.State( wc_dir_other, { 'iota': Item(status='A '), 'A': Item(status=' ', treeconflict='C'), # And what happens below A 'A/mu': Item(status=' ', treeconflict='A'), 'A/D': Item(status=' ', treeconflict='A'), 'A/D/G': Item(status=' ', treeconflict='A'), 'A/D/G/tau': Item(status=' ', treeconflict='A'), 'A/D/G/pi': Item(status=' ', treeconflict='A'), 'A/D/G/rho': Item(status=' ', treeconflict='A'), 'A/D/H': Item(status=' ', treeconflict='A'), 'A/D/H/psi': Item(status=' ', treeconflict='A'), 'A/D/H/omega': Item(status=' ', treeconflict='A'), 'A/D/H/chi': Item(status=' ', treeconflict='A'), 'A/D/gamma': Item(status=' ', treeconflict='A'), 'A/C': Item(status=' ', treeconflict='A'), 'A/B': Item(status=' ', treeconflict='A'), 'A/B/E': Item(status=' ', treeconflict='A'), 'A/B/E/beta': Item(status=' ', treeconflict='A'), 'A/B/E/alpha': Item(status=' ', treeconflict='A'), 'A/B/F': Item(status=' ', treeconflict='A'), 'A/B/lambda': Item(status=' ', treeconflict='A'), }) expected_disk = svntest.main.greek_state.copy() expected_disk.remove('A/B', 'A/B/E', 'A/B/E/beta', 'A/B/E/alpha', 'A/B/F', 'A/B/lambda', 'A/D', 'A/D/G', 'A/D/G/rho', 'A/D/G/pi', 'A/D/G/tau', 'A/D/H', 'A/D/H/psi', 'A/D/H/omega', 'A/D/H/chi', 'A/D/gamma', 'A/mu', 'A/C') expected_disk.tweak('A', contents='The file A\n') actions.run_and_verify_checkout(url, wc_dir_other, expected_output, expected_disk, None, None, None, None, '--force') # Now see to it that we can recover from the obstructions. # rm wc_dir_other/A os.remove(other_A) # svn up wc_dir_other expected_output = svntest.wc.State(wc_dir_other, {}) expected_disk = svntest.main.greek_state.copy() expected_status = actions.get_virginal_state(wc_dir_other, 1) svntest.main.run_svn(None, 'revert', '-R', os.path.join(wc_dir_other, 'A')) actions.run_and_verify_update(wc_dir_other, expected_output, expected_disk, expected_status, None, None, None, None, None, False, wc_dir_other)
def checkout_with_obstructions(sbox): """co with obstructions conflicts without --force""" make_local_tree(sbox, False, False) #svntest.factory.make(sbox, # """# Checkout with unversioned obstructions lying around. # svn co url wc_dir # svn status""") #svntest.factory.make(sbox, # """# Now see to it that we can recover from the obstructions. # rm -rf A iota # svn up""") #exit(0) wc_dir = sbox.wc_dir url = sbox.repo_url # Checkout with unversioned obstructions causes tree conflicts. # svn co url wc_dir expected_output = svntest.wc.State( wc_dir, { 'iota': Item(status=' ', treeconflict='C'), 'A': Item(status=' ', treeconflict='C'), # And the updates below the tree conflict 'A/D': Item(status=' ', treeconflict='A'), 'A/D/gamma': Item(status=' ', treeconflict='A'), 'A/D/G': Item(status=' ', treeconflict='A'), 'A/D/G/rho': Item(status=' ', treeconflict='A'), 'A/D/G/pi': Item(status=' ', treeconflict='A'), 'A/D/G/tau': Item(status=' ', treeconflict='A'), 'A/D/H': Item(status=' ', treeconflict='A'), 'A/D/H/chi': Item(status=' ', treeconflict='A'), 'A/D/H/omega': Item(status=' ', treeconflict='A'), 'A/D/H/psi': Item(status=' ', treeconflict='A'), 'A/B': Item(status=' ', treeconflict='A'), 'A/B/E': Item(status=' ', treeconflict='A'), 'A/B/E/beta': Item(status=' ', treeconflict='A'), 'A/B/E/alpha': Item(status=' ', treeconflict='A'), 'A/B/F': Item(status=' ', treeconflict='A'), 'A/B/lambda': Item(status=' ', treeconflict='A'), 'A/C': Item(status=' ', treeconflict='A'), 'A/mu': Item(status=' ', treeconflict='A'), }) expected_disk = svntest.main.greek_state.copy() expected_disk.remove('A/B', 'A/B/E', 'A/B/E/beta', 'A/B/E/alpha', 'A/B/F', 'A/B/lambda', 'A/D', 'A/D/G', 'A/D/G/rho', 'A/D/G/pi', 'A/D/G/tau', 'A/D/H', 'A/D/H/psi', 'A/D/H/omega', 'A/D/H/chi', 'A/D/gamma', 'A/C') actions.run_and_verify_checkout2(False, url, wc_dir, expected_output, expected_disk, None, None, None, None) # svn status expected_status = actions.get_virginal_state(wc_dir, 1) # A and iota are tree conflicted and obstructed expected_status.tweak('A', 'iota', status='D ', wc_rev=1, treeconflict='C') expected_status.tweak('A/D', 'A/D/G', 'A/D/G/rho', 'A/D/G/pi', 'A/D/G/tau', 'A/D/H', 'A/D/H/chi', 'A/D/H/omega', 'A/D/H/psi', 'A/D/gamma', 'A/B', 'A/B/E', 'A/B/E/beta', 'A/B/E/alpha', 'A/B/F', 'A/B/lambda', 'A/C', status='D ') # A/mu exists on disk, but is deleted expected_status.tweak('A/mu', status='D ') actions.run_and_verify_unquiet_status(wc_dir, expected_status) # Now see to it that we can recover from the obstructions. # rm -rf A iota svntest.main.safe_rmtree(os.path.join(wc_dir, 'A')) os.remove(os.path.join(wc_dir, 'iota')) svntest.main.run_svn(None, 'revert', '-R', os.path.join(wc_dir, 'A'), os.path.join(wc_dir, 'iota')) # svn up expected_output = svntest.wc.State(wc_dir, {}) expected_disk = svntest.main.greek_state.copy() expected_status = actions.get_virginal_state(wc_dir, 1) actions.run_and_verify_update(wc_dir, expected_output, expected_disk, expected_status, None, None, None, None, None, False, wc_dir)
def forced_checkout_of_dir_with_file_obstructions(sbox): """forced co flags conflict if a file obstructs a dir""" make_local_tree(sbox, False, False) #svntest.factory.make(sbox,""" # mkdir wc_dir_other # echo "The file A" > wc_dir_other/A # svn co --force url wc_dir_other # """) #svntest.factory.make(sbox,""" # # Now see to it that we can recover from the obstructions. # rm wc_dir_other/A # svn up wc_dir_other""") #exit(0) url = sbox.repo_url wc_dir_other = sbox.add_wc_path('other') other_A = os.path.join(wc_dir_other, 'A') # mkdir wc_dir_other os.makedirs(wc_dir_other) # echo "The file A" > wc_dir_other/A svntest.main.file_write(other_A, 'The file A\n') # svn co --force url wc_dir_other expected_output = svntest.wc.State(wc_dir_other, { 'iota' : Item(status='A '), 'A' : Item(status=' ', treeconflict='C'), # And what happens below A 'A/mu' : Item(status=' ', treeconflict='A'), 'A/D' : Item(status=' ', treeconflict='A'), 'A/D/G' : Item(status=' ', treeconflict='A'), 'A/D/G/tau' : Item(status=' ', treeconflict='A'), 'A/D/G/pi' : Item(status=' ', treeconflict='A'), 'A/D/G/rho' : Item(status=' ', treeconflict='A'), 'A/D/H' : Item(status=' ', treeconflict='A'), 'A/D/H/psi' : Item(status=' ', treeconflict='A'), 'A/D/H/omega' : Item(status=' ', treeconflict='A'), 'A/D/H/chi' : Item(status=' ', treeconflict='A'), 'A/D/gamma' : Item(status=' ', treeconflict='A'), 'A/C' : Item(status=' ', treeconflict='A'), 'A/B' : Item(status=' ', treeconflict='A'), 'A/B/E' : Item(status=' ', treeconflict='A'), 'A/B/E/beta' : Item(status=' ', treeconflict='A'), 'A/B/E/alpha' : Item(status=' ', treeconflict='A'), 'A/B/F' : Item(status=' ', treeconflict='A'), 'A/B/lambda' : Item(status=' ', treeconflict='A'), }) expected_disk = svntest.main.greek_state.copy() expected_disk.remove('A/B', 'A/B/E', 'A/B/E/beta', 'A/B/E/alpha', 'A/B/F', 'A/B/lambda', 'A/D', 'A/D/G', 'A/D/G/rho', 'A/D/G/pi', 'A/D/G/tau', 'A/D/H', 'A/D/H/psi', 'A/D/H/omega', 'A/D/H/chi', 'A/D/gamma', 'A/mu', 'A/C') expected_disk.tweak('A', contents='The file A\n') actions.run_and_verify_checkout(url, wc_dir_other, expected_output, expected_disk, [], '--force') # Now see to it that we can recover from the obstructions. # rm wc_dir_other/A os.remove(other_A) # svn up wc_dir_other expected_output = svntest.wc.State(wc_dir_other, { }) expected_disk = svntest.main.greek_state.copy() expected_status = actions.get_virginal_state(wc_dir_other, 1) svntest.main.run_svn(None, 'revert', '-R', os.path.join(wc_dir_other, 'A')) actions.run_and_verify_update(wc_dir_other, expected_output, expected_disk, expected_status)
def checkout_with_obstructions(sbox): """co with obstructions conflicts without --force""" make_local_tree(sbox, False, False) #svntest.factory.make(sbox, # """# Checkout with unversioned obstructions lying around. # svn co url wc_dir # svn status""") #svntest.factory.make(sbox, # """# Now see to it that we can recover from the obstructions. # rm -rf A iota # svn up""") #exit(0) wc_dir = sbox.wc_dir url = sbox.repo_url # Checkout with unversioned obstructions causes tree conflicts. # svn co url wc_dir expected_output = svntest.wc.State(wc_dir, { 'iota' : Item(status=' ', treeconflict='C'), 'A' : Item(status=' ', treeconflict='C'), # And the updates below the tree conflict 'A/D' : Item(status=' ', treeconflict='A'), 'A/D/gamma' : Item(status=' ', treeconflict='A'), 'A/D/G' : Item(status=' ', treeconflict='A'), 'A/D/G/rho' : Item(status=' ', treeconflict='A'), 'A/D/G/pi' : Item(status=' ', treeconflict='A'), 'A/D/G/tau' : Item(status=' ', treeconflict='A'), 'A/D/H' : Item(status=' ', treeconflict='A'), 'A/D/H/chi' : Item(status=' ', treeconflict='A'), 'A/D/H/omega' : Item(status=' ', treeconflict='A'), 'A/D/H/psi' : Item(status=' ', treeconflict='A'), 'A/B' : Item(status=' ', treeconflict='A'), 'A/B/E' : Item(status=' ', treeconflict='A'), 'A/B/E/beta' : Item(status=' ', treeconflict='A'), 'A/B/E/alpha' : Item(status=' ', treeconflict='A'), 'A/B/F' : Item(status=' ', treeconflict='A'), 'A/B/lambda' : Item(status=' ', treeconflict='A'), 'A/C' : Item(status=' ', treeconflict='A'), 'A/mu' : Item(status=' ', treeconflict='A'), }) expected_disk = svntest.main.greek_state.copy() expected_disk.remove('A/B', 'A/B/E', 'A/B/E/beta', 'A/B/E/alpha', 'A/B/F', 'A/B/lambda', 'A/D', 'A/D/G', 'A/D/G/rho', 'A/D/G/pi', 'A/D/G/tau', 'A/D/H', 'A/D/H/psi', 'A/D/H/omega', 'A/D/H/chi', 'A/D/gamma', 'A/C') actions.run_and_verify_checkout(url, wc_dir, expected_output, expected_disk) # svn status expected_status = actions.get_virginal_state(wc_dir, 1) # A and iota are tree conflicted and obstructed expected_status.tweak('A', 'iota', status='D ', wc_rev=1, treeconflict='C') expected_status.tweak('A/D', 'A/D/G', 'A/D/G/rho', 'A/D/G/pi', 'A/D/G/tau', 'A/D/H', 'A/D/H/chi', 'A/D/H/omega', 'A/D/H/psi', 'A/D/gamma', 'A/B', 'A/B/E', 'A/B/E/beta', 'A/B/E/alpha', 'A/B/F', 'A/B/lambda', 'A/C', status='D ') # A/mu exists on disk, but is deleted expected_status.tweak('A/mu', status='D ') actions.run_and_verify_unquiet_status(wc_dir, expected_status) # Now see to it that we can recover from the obstructions. # rm -rf A iota svntest.main.safe_rmtree( os.path.join(wc_dir, 'A') ) os.remove( os.path.join(wc_dir, 'iota') ) svntest.main.run_svn(None, 'revert', '-R', os.path.join(wc_dir, 'A'), os.path.join(wc_dir, 'iota')) # svn up expected_output = svntest.wc.State(wc_dir, { }) expected_disk = svntest.main.greek_state.copy() expected_status = actions.get_virginal_state(wc_dir, 1) actions.run_and_verify_update(wc_dir, expected_output, expected_disk, expected_status,)
def forced_checkout_of_dir_with_file_obstructions(sbox): """forced co flags conflict if a file obstructs a dir""" make_local_tree(sbox, False, False) # svntest.factory.make(sbox,""" # mkdir wc_dir_other # echo "The file A" > wc_dir_other/A # svn co --force url wc_dir_other # """) # svntest.factory.make(sbox,""" # # Now see to it that we can recover from the obstructions. # rm wc_dir_other/A # svn up wc_dir_other""") # exit(0) url = sbox.repo_url wc_dir_other = sbox.add_wc_path("other") other_A = os.path.join(wc_dir_other, "A") # mkdir wc_dir_other os.makedirs(wc_dir_other) # echo "The file A" > wc_dir_other/A svntest.main.file_write(other_A, "The file A\n") # svn co --force url wc_dir_other expected_output = svntest.wc.State( wc_dir_other, { "iota": Item(status="A "), "A": Item(status=" ", treeconflict="C"), # And what happens below A "A/mu": Item(status=" ", treeconflict="A"), "A/D": Item(status=" ", treeconflict="A"), "A/D/G": Item(status=" ", treeconflict="A"), "A/D/G/tau": Item(status=" ", treeconflict="A"), "A/D/G/pi": Item(status=" ", treeconflict="A"), "A/D/G/rho": Item(status=" ", treeconflict="A"), "A/D/H": Item(status=" ", treeconflict="A"), "A/D/H/psi": Item(status=" ", treeconflict="A"), "A/D/H/omega": Item(status=" ", treeconflict="A"), "A/D/H/chi": Item(status=" ", treeconflict="A"), "A/D/gamma": Item(status=" ", treeconflict="A"), "A/C": Item(status=" ", treeconflict="A"), "A/B": Item(status=" ", treeconflict="A"), "A/B/E": Item(status=" ", treeconflict="A"), "A/B/E/beta": Item(status=" ", treeconflict="A"), "A/B/E/alpha": Item(status=" ", treeconflict="A"), "A/B/F": Item(status=" ", treeconflict="A"), "A/B/lambda": Item(status=" ", treeconflict="A"), }, ) expected_disk = svntest.main.greek_state.copy() expected_disk.remove( "A/B", "A/B/E", "A/B/E/beta", "A/B/E/alpha", "A/B/F", "A/B/lambda", "A/D", "A/D/G", "A/D/G/rho", "A/D/G/pi", "A/D/G/tau", "A/D/H", "A/D/H/psi", "A/D/H/omega", "A/D/H/chi", "A/D/gamma", "A/mu", "A/C", ) expected_disk.tweak("A", contents="The file A\n") actions.run_and_verify_checkout(url, wc_dir_other, expected_output, expected_disk, [], "--force") # Now see to it that we can recover from the obstructions. # rm wc_dir_other/A os.remove(other_A) # svn up wc_dir_other expected_output = svntest.wc.State(wc_dir_other, {}) expected_disk = svntest.main.greek_state.copy() expected_status = actions.get_virginal_state(wc_dir_other, 1) svntest.main.run_svn(None, "revert", "-R", os.path.join(wc_dir_other, "A")) actions.run_and_verify_update(wc_dir_other, expected_output, expected_disk, expected_status)
def checkout_with_obstructions(sbox): """co with obstructions conflicts without --force""" make_local_tree(sbox, False, False) # svntest.factory.make(sbox, # """# Checkout with unversioned obstructions lying around. # svn co url wc_dir # svn status""") # svntest.factory.make(sbox, # """# Now see to it that we can recover from the obstructions. # rm -rf A iota # svn up""") # exit(0) wc_dir = sbox.wc_dir url = sbox.repo_url # Checkout with unversioned obstructions causes tree conflicts. # svn co url wc_dir expected_output = svntest.wc.State( wc_dir, { "iota": Item(status=" ", treeconflict="C"), "A": Item(status=" ", treeconflict="C"), # And the updates below the tree conflict "A/D": Item(status=" ", treeconflict="A"), "A/D/gamma": Item(status=" ", treeconflict="A"), "A/D/G": Item(status=" ", treeconflict="A"), "A/D/G/rho": Item(status=" ", treeconflict="A"), "A/D/G/pi": Item(status=" ", treeconflict="A"), "A/D/G/tau": Item(status=" ", treeconflict="A"), "A/D/H": Item(status=" ", treeconflict="A"), "A/D/H/chi": Item(status=" ", treeconflict="A"), "A/D/H/omega": Item(status=" ", treeconflict="A"), "A/D/H/psi": Item(status=" ", treeconflict="A"), "A/B": Item(status=" ", treeconflict="A"), "A/B/E": Item(status=" ", treeconflict="A"), "A/B/E/beta": Item(status=" ", treeconflict="A"), "A/B/E/alpha": Item(status=" ", treeconflict="A"), "A/B/F": Item(status=" ", treeconflict="A"), "A/B/lambda": Item(status=" ", treeconflict="A"), "A/C": Item(status=" ", treeconflict="A"), "A/mu": Item(status=" ", treeconflict="A"), }, ) expected_disk = svntest.main.greek_state.copy() expected_disk.remove( "A/B", "A/B/E", "A/B/E/beta", "A/B/E/alpha", "A/B/F", "A/B/lambda", "A/D", "A/D/G", "A/D/G/rho", "A/D/G/pi", "A/D/G/tau", "A/D/H", "A/D/H/psi", "A/D/H/omega", "A/D/H/chi", "A/D/gamma", "A/C", ) actions.run_and_verify_checkout(url, wc_dir, expected_output, expected_disk) # svn status expected_status = actions.get_virginal_state(wc_dir, 1) # A and iota are tree conflicted and obstructed expected_status.tweak("A", "iota", status="D ", wc_rev=1, treeconflict="C") expected_status.tweak( "A/D", "A/D/G", "A/D/G/rho", "A/D/G/pi", "A/D/G/tau", "A/D/H", "A/D/H/chi", "A/D/H/omega", "A/D/H/psi", "A/D/gamma", "A/B", "A/B/E", "A/B/E/beta", "A/B/E/alpha", "A/B/F", "A/B/lambda", "A/C", status="D ", ) # A/mu exists on disk, but is deleted expected_status.tweak("A/mu", status="D ") actions.run_and_verify_unquiet_status(wc_dir, expected_status) # Now see to it that we can recover from the obstructions. # rm -rf A iota svntest.main.safe_rmtree(os.path.join(wc_dir, "A")) os.remove(os.path.join(wc_dir, "iota")) svntest.main.run_svn(None, "revert", "-R", os.path.join(wc_dir, "A"), os.path.join(wc_dir, "iota")) # svn up expected_output = svntest.wc.State(wc_dir, {}) expected_disk = svntest.main.greek_state.copy() expected_status = actions.get_virginal_state(wc_dir, 1) actions.run_and_verify_update(wc_dir, expected_output, expected_disk, expected_status)