merge_reintegrate_tests.py [plain text]
import shutil, sys, re, os
import time
import svntest
from svntest import main, wc, verify, actions
Item = wc.StateItem
Skip = svntest.testcase.Skip_deco
SkipUnless = svntest.testcase.SkipUnless_deco
XFail = svntest.testcase.XFail_deco
Issues = svntest.testcase.Issues_deco
Issue = svntest.testcase.Issue_deco
Wimp = svntest.testcase.Wimp_deco
exp_noop_up_out = svntest.actions.expected_noop_update_output
from svntest.main import SVN_PROP_MERGEINFO
from svntest.main import server_has_mergeinfo
from merge_tests import set_up_branch
from merge_tests import expected_merge_output
@SkipUnless(server_has_mergeinfo)
@Issue(3640)
def basic_reintegrate(sbox):
"basic merge --reintegrate support"
sbox.build()
wc_dir = sbox.wc_dir
expected_disk, expected_status = set_up_branch(sbox)
svntest.main.file_write(os.path.join(wc_dir, "A_COPY", "mu"),
"Changed on the branch.")
expected_output = wc.State(wc_dir, {'A_COPY/mu' : Item(verb='Sending')})
expected_status.tweak('A_COPY/mu', wc_rev=7)
svntest.actions.run_and_verify_commit(wc_dir, expected_output,
expected_status, None, wc_dir)
expected_disk.tweak('A_COPY/mu', contents='Changed on the branch.')
expected_output = wc.State(wc_dir, {})
expected_status.tweak(wc_rev='7')
svntest.actions.run_and_verify_update(wc_dir, expected_output,
expected_disk, expected_status,
None, None, None, None, None, True)
A_COPY_path = os.path.join(wc_dir, "A_COPY")
expected_output = wc.State(A_COPY_path, {
'D/H/psi' : Item(status='U '),
'D/G/rho' : Item(status='U '),
'B/E/beta' : Item(status='U '),
'D/H/omega' : Item(status='U '),
})
expected_mergeinfo_output = wc.State(A_COPY_path, {
'' : Item(status=' U'),
})
expected_elision_output = wc.State(A_COPY_path, {
})
k_expected_status = wc.State(A_COPY_path, {
"B" : Item(status=' ', wc_rev=7),
"B/lambda" : Item(status=' ', wc_rev=7),
"B/E" : Item(status=' ', wc_rev=7),
"B/E/alpha" : Item(status=' ', wc_rev=7),
"B/E/beta" : Item(status='M ', wc_rev=7),
"B/F" : Item(status=' ', wc_rev=7),
"mu" : Item(status=' ', wc_rev=7),
"C" : Item(status=' ', wc_rev=7),
"D" : Item(status=' ', wc_rev=7),
"D/gamma" : Item(status=' ', wc_rev=7),
"D/G" : Item(status=' ', wc_rev=7),
"D/G/pi" : Item(status=' ', wc_rev=7),
"D/G/rho" : Item(status='M ', wc_rev=7),
"D/G/tau" : Item(status=' ', wc_rev=7),
"D/H" : Item(status=' ', wc_rev=7),
"D/H/chi" : Item(status=' ', wc_rev=7),
"D/H/omega" : Item(status='M ', wc_rev=7),
"D/H/psi" : Item(status='M ', wc_rev=7),
"" : Item(status=' M', wc_rev=7),
})
k_expected_disk = wc.State('', {
'' : Item(props={SVN_PROP_MERGEINFO : '/A:2-7'}),
'B' : Item(),
'B/lambda' : Item("This is the file 'lambda'.\n"),
'B/E' : Item(),
'B/E/alpha' : Item("This is the file 'alpha'.\n"),
'B/E/beta' : Item("New content"),
'B/F' : Item(),
'mu' : Item("Changed on the branch."),
'C' : Item(),
'D' : Item(),
'D/gamma' : Item("This is the file 'gamma'.\n"),
'D/G' : Item(),
'D/G/pi' : Item("This is the file 'pi'.\n"),
'D/G/rho' : Item("New content"),
'D/G/tau' : Item("This is the file 'tau'.\n"),
'D/H' : Item(),
'D/H/chi' : Item("This is the file 'chi'.\n"),
'D/H/omega' : Item("New content"),
'D/H/psi' : Item("New content"),
})
expected_skip = wc.State(A_COPY_path, {})
svntest.actions.run_and_verify_merge(A_COPY_path, None, None,
sbox.repo_url + '/A', None,
expected_output,
expected_mergeinfo_output,
expected_elision_output,
k_expected_disk,
k_expected_status,
expected_skip,
None, None, None, None,
None, True)
expected_disk.tweak('A_COPY', props={SVN_PROP_MERGEINFO: '/A:2-7'})
expected_disk.tweak('A_COPY/B/E/beta', contents="New content")
expected_disk.tweak('A_COPY/D/G/rho', contents="New content")
expected_disk.tweak('A_COPY/D/H/omega', contents="New content")
expected_disk.tweak('A_COPY/D/H/psi', contents="New content")
expected_output = wc.State(wc_dir, {
'A_COPY/D/H/psi' : Item(verb='Sending'),
'A_COPY/D/G/rho' : Item(verb='Sending'),
'A_COPY/B/E/beta' : Item(verb='Sending'),
'A_COPY/D/H/omega' : Item(verb='Sending'),
'A_COPY' : Item(verb='Sending'),
})
expected_status.tweak('A_COPY', 'A_COPY/D/H/psi', 'A_COPY/D/G/rho',
'A_COPY/B/E/beta', 'A_COPY/D/H/omega', wc_rev=8)
svntest.actions.run_and_verify_commit(wc_dir, expected_output,
expected_status, None, wc_dir)
expected_output = wc.State(wc_dir, {})
expected_status.tweak(wc_rev='8')
svntest.actions.run_and_verify_update(wc_dir, expected_output,
expected_disk, expected_status,
None, None, None, None, None, True)
A_path = os.path.join(wc_dir, "A")
expected_output = wc.State(A_path, {
'mu' : Item(status='U '),
})
expected_mergeinfo_output = wc.State(A_path, {
'' : Item(status=' U'),
})
expected_elision_output = wc.State(A_path, {
})
k_expected_status = wc.State(A_path, {
"B" : Item(status=' ', wc_rev=8),
"B/lambda" : Item(status=' ', wc_rev=8),
"B/E" : Item(status=' ', wc_rev=8),
"B/E/alpha" : Item(status=' ', wc_rev=8),
"B/E/beta" : Item(status=' ', wc_rev=8),
"B/F" : Item(status=' ', wc_rev=8),
"mu" : Item(status='M ', wc_rev=8),
"C" : Item(status=' ', wc_rev=8),
"D" : Item(status=' ', wc_rev=8),
"D/gamma" : Item(status=' ', wc_rev=8),
"D/G" : Item(status=' ', wc_rev=8),
"D/G/pi" : Item(status=' ', wc_rev=8),
"D/G/rho" : Item(status=' ', wc_rev=8),
"D/G/tau" : Item(status=' ', wc_rev=8),
"D/H" : Item(status=' ', wc_rev=8),
"D/H/chi" : Item(status=' ', wc_rev=8),
"D/H/omega" : Item(status=' ', wc_rev=8),
"D/H/psi" : Item(status=' ', wc_rev=8),
"" : Item(status=' M', wc_rev=8),
})
k_expected_disk.tweak('', props={SVN_PROP_MERGEINFO : '/A_COPY:2-8'})
expected_skip = wc.State(A_path, {})
svntest.actions.run_and_verify_merge(A_path, None, None,
sbox.repo_url + '/A_COPY', None,
expected_output,
expected_mergeinfo_output,
expected_elision_output,
k_expected_disk,
k_expected_status,
expected_skip,
None, None, None, None,
None, True, True,
'--reintegrate', A_path)
svntest.actions.run_and_verify_svn(None, None, [], 'revert', '-R', wc_dir)
svntest.actions.run_and_verify_svn(None,
['\n', 'Committed revision 9.\n'],
[], 'move',
sbox.repo_url + '/A',
sbox.repo_url + '/A_MOVED',
'-m', 'Copy A to A_MOVED')
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
A_MOVED_path = os.path.join(wc_dir, "A_MOVED")
expected_output = wc.State(A_MOVED_path, {
'mu' : Item(status='U '),
})
expected_mergeinfo_output = wc.State(A_MOVED_path, {
'' : Item(status=' U'),
})
expected_elision_output = wc.State(A_MOVED_path, {
})
expected_status = wc.State(A_MOVED_path, {
"B" : Item(status=' '),
"B/lambda" : Item(status=' '),
"B/E" : Item(status=' '),
"B/E/alpha" : Item(status=' '),
"B/E/beta" : Item(status=' '),
"B/F" : Item(status=' '),
"mu" : Item(status='M '),
"C" : Item(status=' '),
"D" : Item(status=' '),
"D/gamma" : Item(status=' '),
"D/G" : Item(status=' '),
"D/G/pi" : Item(status=' '),
"D/G/rho" : Item(status=' '),
"D/G/tau" : Item(status=' '),
"D/H" : Item(status=' '),
"D/H/chi" : Item(status=' '),
"D/H/omega" : Item(status=' '),
"D/H/psi" : Item(status=' '),
"" : Item(status=' M'),
})
expected_status.tweak(wc_rev=9)
k_expected_disk.tweak('', props={SVN_PROP_MERGEINFO : '/A_COPY:2-9'})
expected_skip = wc.State(A_MOVED_path, {})
svntest.actions.run_and_verify_merge(A_MOVED_path, None, None,
sbox.repo_url + '/A_COPY', None,
expected_output,
expected_mergeinfo_output,
expected_elision_output,
k_expected_disk,
expected_status,
expected_skip,
None, None, None, None,
None, True, True,
'--reintegrate', A_MOVED_path)
def reintegrate_with_rename(sbox):
"merge --reintegrate with renamed file on branch"
sbox.build()
wc_dir = sbox.wc_dir
expected_disk, expected_status = set_up_branch(sbox)
svntest.main.file_write(os.path.join(wc_dir, "A_COPY", "mu"),
"Changed on the branch.")
expected_output = wc.State(wc_dir, {'A_COPY/mu' : Item(verb='Sending')})
expected_status.tweak('A_COPY/mu', wc_rev=7)
svntest.actions.run_and_verify_commit(wc_dir, expected_output,
expected_status, None, wc_dir)
expected_disk.tweak('A_COPY/mu', contents='Changed on the branch.')
expected_output = wc.State(wc_dir, {})
expected_status.tweak(wc_rev='7')
svntest.actions.run_and_verify_update(wc_dir, expected_output,
expected_disk, expected_status,
None, None, None, None, None, True)
A_COPY_path = os.path.join(wc_dir, "A_COPY")
expected_output = wc.State(A_COPY_path, {
'D/H/psi' : Item(status='U '),
'D/G/rho' : Item(status='U '),
'B/E/beta' : Item(status='U '),
'D/H/omega' : Item(status='U '),
})
expected_mergeinfo_output = wc.State(A_COPY_path, {
'' : Item(status=' U'),
})
expected_elision_output = wc.State(A_COPY_path, {
})
k_expected_status = wc.State(A_COPY_path, {
"B" : Item(status=' ', wc_rev=7),
"B/lambda" : Item(status=' ', wc_rev=7),
"B/E" : Item(status=' ', wc_rev=7),
"B/E/alpha" : Item(status=' ', wc_rev=7),
"B/E/beta" : Item(status='M ', wc_rev=7),
"B/F" : Item(status=' ', wc_rev=7),
"mu" : Item(status=' ', wc_rev=7),
"C" : Item(status=' ', wc_rev=7),
"D" : Item(status=' ', wc_rev=7),
"D/gamma" : Item(status=' ', wc_rev=7),
"D/G" : Item(status=' ', wc_rev=7),
"D/G/pi" : Item(status=' ', wc_rev=7),
"D/G/rho" : Item(status='M ', wc_rev=7),
"D/G/tau" : Item(status=' ', wc_rev=7),
"D/H" : Item(status=' ', wc_rev=7),
"D/H/chi" : Item(status=' ', wc_rev=7),
"D/H/omega" : Item(status='M ', wc_rev=7),
"D/H/psi" : Item(status='M ', wc_rev=7),
"" : Item(status=' M', wc_rev=7),
})
k_expected_disk = wc.State('', {
'' : Item(props={SVN_PROP_MERGEINFO : '/A:2-7'}),
'B' : Item(),
'B/lambda' : Item("This is the file 'lambda'.\n"),
'B/E' : Item(),
'B/E/alpha' : Item("This is the file 'alpha'.\n"),
'B/E/beta' : Item("New content"),
'B/F' : Item(),
'mu' : Item("Changed on the branch."),
'C' : Item(),
'D' : Item(),
'D/gamma' : Item("This is the file 'gamma'.\n"),
'D/G' : Item(),
'D/G/pi' : Item("This is the file 'pi'.\n"),
'D/G/rho' : Item("New content"),
'D/G/tau' : Item("This is the file 'tau'.\n"),
'D/H' : Item(),
'D/H/chi' : Item("This is the file 'chi'.\n"),
'D/H/omega' : Item("New content"),
'D/H/psi' : Item("New content"),
})
expected_skip = wc.State(A_COPY_path, {})
svntest.actions.run_and_verify_merge(A_COPY_path, None, None,
sbox.repo_url + '/A', None,
expected_output,
expected_mergeinfo_output,
expected_elision_output,
k_expected_disk,
k_expected_status,
expected_skip,
None, None, None, None,
None, True)
expected_disk.tweak('A_COPY', props={SVN_PROP_MERGEINFO: '/A:2-7'})
expected_disk.tweak('A_COPY/B/E/beta', contents="New content")
expected_disk.tweak('A_COPY/D/G/rho', contents="New content")
expected_disk.tweak('A_COPY/D/H/omega', contents="New content")
expected_disk.tweak('A_COPY/D/H/psi', contents="New content")
expected_output = wc.State(wc_dir, {
'A_COPY/D/H/psi' : Item(verb='Sending'),
'A_COPY/D/G/rho' : Item(verb='Sending'),
'A_COPY/B/E/beta' : Item(verb='Sending'),
'A_COPY/D/H/omega' : Item(verb='Sending'),
'A_COPY' : Item(verb='Sending'),
})
expected_status.tweak('A_COPY', 'A_COPY/D/H/psi', 'A_COPY/D/G/rho',
'A_COPY/B/E/beta', 'A_COPY/D/H/omega', wc_rev=8)
svntest.actions.run_and_verify_commit(wc_dir, expected_output,
expected_status, None, wc_dir)
expected_output = wc.State(wc_dir, {})
expected_status.tweak(wc_rev='8')
svntest.actions.run_and_verify_update(wc_dir, expected_output,
expected_disk, expected_status,
None, None, None, None, None, True)
svntest.actions.run_and_verify_svn(None, None, [], 'cp',
sbox.repo_url + '/A_COPY/D/G/tau',
sbox.repo_url + '/A_COPY/D/G/tauprime',
'-m',
'Repos to repos copy of tau to tauprime')
expected_output = wc.State(wc_dir, {
'A_COPY/D/G/tauprime' : Item(verb='Adding')
})
expected_output = wc.State(A_COPY_path, {
'D/G/tauprime' : Item(status='A '),
})
expected_status.add({'A_COPY/D/G/tauprime': Item(status=' ', wc_rev=9)})
expected_disk.add({
'A_COPY/D/G/tauprime' : Item(props={SVN_PROP_MERGEINFO: '/A/D/G/tau:2-7'},
contents="This is the file 'tau'.\n")
})
expected_status.tweak(wc_rev='9')
svntest.actions.run_and_verify_update(wc_dir, expected_output,
expected_disk, expected_status,
None, None, None, None, None, True)
A_path = os.path.join(wc_dir, "A")
expected_output = wc.State(A_path, {
'mu' : Item(status='U '),
'D/G/tauprime' : Item(status='A '),
})
expected_mergeinfo_output = wc.State(A_path, {
'' : Item(status=' U'),
'D/G/tauprime' : Item(status=' U'),
})
expected_elision_output = wc.State(A_path, {
})
k_expected_status = wc.State(A_path, {
"B" : Item(status=' ', wc_rev=9),
"B/lambda" : Item(status=' ', wc_rev=9),
"B/E" : Item(status=' ', wc_rev=9),
"B/E/alpha" : Item(status=' ', wc_rev=9),
"B/E/beta" : Item(status=' ', wc_rev=9),
"B/F" : Item(status=' ', wc_rev=9),
"mu" : Item(status='M ', wc_rev=9),
"C" : Item(status=' ', wc_rev=9),
"D" : Item(status=' ', wc_rev=9),
"D/gamma" : Item(status=' ', wc_rev=9),
"D/G" : Item(status=' ', wc_rev=9),
"D/G/pi" : Item(status=' ', wc_rev=9),
"D/G/rho" : Item(status=' ', wc_rev=9),
"D/G/tau" : Item(status=' ', wc_rev=9),
"D/G/tauprime" : Item(status='A ', wc_rev='-', copied='+'),
"D/H" : Item(status=' ', wc_rev=9),
"D/H/chi" : Item(status=' ', wc_rev=9),
"D/H/omega" : Item(status=' ', wc_rev=9),
"D/H/psi" : Item(status=' ', wc_rev=9),
"" : Item(status=' M', wc_rev=9),
})
k_expected_disk.tweak('', props={SVN_PROP_MERGEINFO : '/A_COPY:2-9'})
k_expected_disk.add({
'D/G/tauprime' : Item(props={SVN_PROP_MERGEINFO :
'/A/D/G/tau:2-7\n/A_COPY/D/G/tauprime:9'},
contents="This is the file 'tau'.\n")
})
expected_skip = wc.State(A_path, {})
svntest.actions.run_and_verify_merge(A_path, None, None,
sbox.repo_url + '/A_COPY', None,
expected_output,
expected_mergeinfo_output,
expected_elision_output,
k_expected_disk,
k_expected_status,
expected_skip,
None, None, None, None,
None, True, True,
'--reintegrate', A_path)
expected_output = wc.State(wc_dir, {
'A/D/G/tauprime' : Item(verb='Adding'),
'A/mu' : Item(verb='Sending'),
'A' : Item(verb='Sending'),
})
expected_status.add({
'A/D/G/tauprime' : Item(status=' ', wc_rev=10),
})
expected_status.tweak('A', 'A/mu', wc_rev=10)
svntest.actions.run_and_verify_commit(wc_dir, expected_output,
expected_status, None, wc_dir)
def reintegrate_branch_never_merged_to(sbox):
"merge --reintegrate on a never-updated branch"
sbox.build()
wc_dir = sbox.wc_dir
expected_disk, expected_status = set_up_branch(sbox)
svntest.main.file_write(os.path.join(wc_dir, "A_COPY", "mu"),
"Changed on the branch.")
expected_output = wc.State(wc_dir, {'A_COPY/mu' : Item(verb='Sending')})
expected_status.tweak('A_COPY/mu', wc_rev=7)
svntest.actions.run_and_verify_commit(wc_dir, expected_output,
expected_status, None, wc_dir)
expected_disk.tweak('A_COPY/mu', contents='Changed on the branch.')
expected_output = wc.State(wc_dir, {})
expected_status.tweak(wc_rev='7')
svntest.actions.run_and_verify_update(wc_dir, expected_output,
expected_disk, expected_status,
None, None, None, None, None, True)
svntest.actions.run_and_verify_svn(None, None, [], 'cp',
os.path.join(wc_dir, 'A_COPY', 'D', 'G',
'tau'),
os.path.join(wc_dir, 'A_COPY', 'D', 'G',
'tauprime'))
expected_output = wc.State(wc_dir, {
'A_COPY/D/G/tauprime' : Item(verb='Adding')
})
expected_status.add({'A_COPY/D/G/tauprime': Item(status=' ', wc_rev=8)})
svntest.actions.run_and_verify_commit(wc_dir, expected_output,
expected_status, None, wc_dir)
expected_disk.add({
'A_COPY/D/G/tauprime' : Item(contents="This is the file 'tau'.\n")
})
expected_output = wc.State(wc_dir, {})
expected_status.tweak(wc_rev='8')
svntest.actions.run_and_verify_update(wc_dir, expected_output,
expected_disk, expected_status,
None, None, None, None, None, True)
A_path = os.path.join(wc_dir, "A")
expected_output = wc.State(A_path, {
'mu' : Item(status='U '),
'D/G/tauprime' : Item(status='A '),
})
expected_mergeinfo_output = wc.State(A_path, {
'' : Item(status=' U'),
})
expected_elision_output = wc.State(A_path, {
})
k_expected_status = wc.State(A_path, {
"B" : Item(status=' ', wc_rev=8),
"B/lambda" : Item(status=' ', wc_rev=8),
"B/E" : Item(status=' ', wc_rev=8),
"B/E/alpha" : Item(status=' ', wc_rev=8),
"B/E/beta" : Item(status=' ', wc_rev=8),
"B/F" : Item(status=' ', wc_rev=8),
"mu" : Item(status='M ', wc_rev=8),
"C" : Item(status=' ', wc_rev=8),
"D" : Item(status=' ', wc_rev=8),
"D/gamma" : Item(status=' ', wc_rev=8),
"D/G" : Item(status=' ', wc_rev=8),
"D/G/pi" : Item(status=' ', wc_rev=8),
"D/G/rho" : Item(status=' ', wc_rev=8),
"D/G/tau" : Item(status=' ', wc_rev=8),
"D/G/tauprime" : Item(status='A ', wc_rev='-', copied='+'),
"D/H" : Item(status=' ', wc_rev=8),
"D/H/chi" : Item(status=' ', wc_rev=8),
"D/H/omega" : Item(status=' ', wc_rev=8),
"D/H/psi" : Item(status=' ', wc_rev=8),
"" : Item(status=' M', wc_rev=8),
})
k_expected_disk = wc.State('', {
'' : Item(props={SVN_PROP_MERGEINFO : '/A_COPY:2-8'}),
'B' : Item(),
'B/lambda' : Item("This is the file 'lambda'.\n"),
'B/E' : Item(),
'B/E/alpha' : Item("This is the file 'alpha'.\n"),
'B/E/beta' : Item("New content"),
'B/F' : Item(),
'mu' : Item("Changed on the branch."),
'C' : Item(),
'D' : Item(),
'D/gamma' : Item("This is the file 'gamma'.\n"),
'D/G' : Item(),
'D/G/pi' : Item("This is the file 'pi'.\n"),
'D/G/rho' : Item("New content"),
'D/G/tau' : Item("This is the file 'tau'.\n"),
'D/G/tauprime' : Item("This is the file 'tau'.\n"),
'D/H' : Item(),
'D/H/chi' : Item("This is the file 'chi'.\n"),
'D/H/omega' : Item("New content"),
'D/H/psi' : Item("New content"),
})
expected_skip = wc.State(A_path, {})
svntest.actions.run_and_verify_merge(A_path, None, None,
sbox.repo_url + '/A_COPY', None,
expected_output,
expected_mergeinfo_output,
expected_elision_output,
k_expected_disk,
k_expected_status,
expected_skip,
None, None, None, None,
None, True, True,
'--reintegrate', A_path)
expected_output = wc.State(wc_dir, {
'A/D/G/tauprime' : Item(verb='Adding'),
'A/mu' : Item(verb='Sending'),
'A' : Item(verb='Sending'),
})
expected_status.add({
'A/D/G/tauprime' : Item(status=' ', wc_rev=9),
})
expected_status.tweak('A', 'A/mu', wc_rev=9)
svntest.actions.run_and_verify_commit(wc_dir, expected_output,
expected_status, None, wc_dir)
def reintegrate_fail_on_modified_wc(sbox):
"merge --reintegrate should fail in modified wc"
sbox.build()
wc_dir = sbox.wc_dir
A_path = os.path.join(wc_dir, "A")
mu_path = os.path.join(A_path, "mu")
ignored_expected_disk, ignored_expected_status = set_up_branch(sbox)
svntest.main.file_write(mu_path, "Changed on 'trunk' (the merge target).")
sbox.simple_update() svntest.actions.run_and_verify_merge(
A_path, None, None, sbox.repo_url + '/A_COPY', None, None, None, None,
None, None, None,
".*Cannot merge into a working copy that has local modifications.*",
None, None, None, None, True, False, '--reintegrate', A_path)
def reintegrate_fail_on_mixed_rev_wc(sbox):
"merge --reintegrate should fail in mixed-rev wc"
sbox.build()
wc_dir = sbox.wc_dir
A_path = os.path.join(wc_dir, "A")
mu_path = os.path.join(A_path, "mu")
ignored_expected_disk, expected_status = set_up_branch(sbox)
svntest.main.file_write(mu_path, "Changed on 'trunk' (the merge target).")
expected_output = wc.State(wc_dir, {
'A/mu' : Item(verb='Sending'),
})
expected_status.tweak('A/mu', wc_rev=7)
svntest.actions.run_and_verify_commit(wc_dir, expected_output,
expected_status, None, wc_dir)
svntest.actions.run_and_verify_merge(
A_path, None, None, sbox.repo_url + '/A_COPY', None, None, None, None,
None, None, None,
".*Cannot merge into mixed-revision working copy.*",
None, None, None, None, True, False, '--reintegrate', A_path)
def reintegrate_fail_on_switched_wc(sbox):
"merge --reintegrate should fail in switched wc"
sbox.build()
wc_dir = sbox.wc_dir
A_path = os.path.join(wc_dir, "A")
G_path = os.path.join(A_path, "D", "G")
switch_url = sbox.repo_url + "/A/D/H"
expected_disk, expected_status = set_up_branch(sbox)
expected_output = svntest.wc.State(wc_dir, {
'A/D/G/pi' : Item(status='D '),
'A/D/G/rho' : Item(status='D '),
'A/D/G/tau' : Item(status='D '),
'A/D/G/chi' : Item(status='A '),
'A/D/G/psi' : Item(status='A '),
'A/D/G/omega' : Item(status='A '),
})
expected_disk.remove('A/D/G/pi', 'A/D/G/rho', 'A/D/G/tau')
expected_disk.add({
'A/D/G/chi' : Item(contents="This is the file 'chi'.\n"),
'A/D/G/psi' : Item(contents="New content"),
'A/D/G/omega' : Item(contents="New content"),
})
expected_status.remove('A/D/G/pi', 'A/D/G/rho', 'A/D/G/tau')
expected_status.add({
'A/D/G' : Item(status=' ', wc_rev=6, switched='S'),
'A/D/G/chi' : Item(status=' ', wc_rev=6),
'A/D/G/psi' : Item(status=' ', wc_rev=6),
'A/D/G/omega' : Item(status=' ', wc_rev=6),
})
svntest.actions.run_and_verify_switch(wc_dir,
G_path,
switch_url,
expected_output,
expected_disk,
expected_status,
None, None, None, None, None,
False, '--ignore-ancestry')
sbox.simple_update() svntest.actions.run_and_verify_merge(
A_path, None, None, sbox.repo_url + '/A_COPY', None, None, None, None,
None, None, None,
".*Cannot merge into a working copy with a switched subtree.*",
None, None, None, None, True, False, '--reintegrate', A_path)
@Issue(3603)
def reintegrate_on_shallow_wc(sbox):
"merge --reintegrate in shallow wc"
sbox.build()
wc_dir = sbox.wc_dir
expected_disk, expected_status = set_up_branch(sbox, branch_only = True)
A_path = os.path.join(wc_dir, "A")
A_D_path = os.path.join(wc_dir, "A", "D")
mu_COPY_path = os.path.join(wc_dir, "A_COPY", "mu")
psi_COPY_path = os.path.join(wc_dir, "A_COPY", "D", "H", "psi")
A_COPY_path = os.path.join(wc_dir, "A_COPY")
svntest.main.file_write(mu_COPY_path, "branch work")
svntest.main.run_svn(None, 'commit', '-m',
'Some work on the A_COPY branch', wc_dir)
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
svntest.actions.run_and_verify_svn(None, None, [], 'up',
'--set-depth', 'empty', A_D_path)
expected_output = wc.State(A_path, {
'mu' : Item(status='U '),
})
expected_mergeinfo_output = wc.State(A_path, {
'' : Item(status=' U'),
})
expected_elision_output = wc.State(A_path, {
})
expected_A_status = wc.State(A_path, {
'' : Item(status=' M'),
'B' : Item(status=' '),
'mu' : Item(status='M '),
'B/E' : Item(status=' '),
'B/E/alpha' : Item(status=' '),
'B/E/beta' : Item(status=' '),
'B/lambda' : Item(status=' '),
'B/F' : Item(status=' '),
'C' : Item(status=' '),
'D' : Item(status=' '), })
expected_A_status.tweak(wc_rev=3)
expected_A_disk = wc.State('', {
'' : Item(props={SVN_PROP_MERGEINFO : '/A_COPY:2-3'}),
'B' : Item(),
'mu' : Item("branch work"),
'B/E' : Item(),
'B/E/alpha' : Item("This is the file 'alpha'.\n"),
'B/E/beta' : Item("This is the file 'beta'.\n"),
'B/lambda' : Item("This is the file 'lambda'.\n"),
'B/F' : Item(),
'C' : Item(),
'D' : Item(), })
expected_A_skip = wc.State(A_path, {})
svntest.actions.run_and_verify_merge(A_path, None, None,
sbox.repo_url + '/A_COPY', None,
expected_output,
expected_mergeinfo_output,
expected_elision_output,
expected_A_disk,
expected_A_status,
expected_A_skip,
None, None, None, None,
None, 1, 1, "--reintegrate", A_path)
svntest.actions.run_and_verify_svn(None, None, [], 'revert', '-R', wc_dir)
svntest.main.file_write(psi_COPY_path, "more branch work")
svntest.main.run_svn(None, 'commit', '-m',
'Some more work on the A_COPY branch', wc_dir)
expected_mergeinfo_output.add({
'D' : Item(status=' U')
})
expected_A_status.tweak('D', status=' M')
expected_A_disk.tweak('D', props={SVN_PROP_MERGEINFO : '/A_COPY/D:2-4*'})
expected_A_skip.add({
'D/H' : Item()
})
expected_A_disk.tweak('', props={SVN_PROP_MERGEINFO : '/A_COPY:2-4'})
svntest.actions.run_and_verify_merge(A_path, None, None,
sbox.repo_url + '/A_COPY', None,
expected_output,
expected_mergeinfo_output,
expected_elision_output,
expected_A_disk,
expected_A_status,
expected_A_skip,
None, None, None, None,
None, 1, 1, "--reintegrate", A_path)
@SkipUnless(server_has_mergeinfo)
def reintegrate_fail_on_stale_source(sbox):
"merge --reintegrate should fail on stale source"
sbox.build()
wc_dir = sbox.wc_dir
expected_disk, expected_status = set_up_branch(sbox)
A_path = os.path.join(wc_dir, "A")
mu_path = os.path.join(A_path, "mu")
svntest.main.file_append(mu_path, 'some text appended to mu\n')
svntest.actions.run_and_verify_svn(None, None, [], 'commit',
'-m', 'a change to mu', mu_path);
svntest.actions.run_and_verify_svn(None, None, [], 'update', wc_dir);
expected_output = wc.State(A_path, {})
expected_mergeinfo_output = wc.State(A_path, {
'' : Item(status=' U'),
})
expected_elision_output = wc.State(A_path, {
})
expected_status = wc.State(A_path, {
'' : Item(status=' M'),
'B' : Item(status=' '),
'mu' : Item(status=' '),
'B/E' : Item(status=' '),
'B/E/alpha' : Item(status=' '),
'B/E/beta' : Item(status=' '),
'B/lambda' : Item(status=' '),
'B/F' : Item(status=' '),
'C' : Item(status=' '),
'D' : Item(status=' '),
'D/G' : Item(status=' '),
'D/G/pi' : Item(status=' '),
'D/G/rho' : Item(status=' '),
'D/G/tau' : Item(status=' '),
'D/gamma' : Item(status=' '),
'D/H' : Item(status=' '),
'D/H/chi' : Item(status=' '),
'D/H/psi' : Item(status=' '),
'D/H/omega' : Item(status=' '),
})
expected_status.tweak(wc_rev=7)
expected_disk = wc.State('', {
'' : Item(props={SVN_PROP_MERGEINFO : '/A_COPY:2-7'}),
'B' : Item(),
'mu' : Item("This is the file 'mu'.\nsome text appended to mu\n"),
'B/E' : Item(),
'B/E/alpha' : Item("This is the file 'alpha'.\n"),
'B/E/beta' : Item("New content"),
'B/lambda' : Item("This is the file 'lambda'.\n"),
'B/F' : Item(),
'C' : Item(),
'D' : Item(),
'D/G' : Item(),
'D/G/pi' : Item("This is the file 'pi'.\n"),
'D/G/rho' : Item("New content"),
'D/G/tau' : Item("This is the file 'tau'.\n"),
'D/gamma' : Item("This is the file 'gamma'.\n"),
'D/H' : Item(),
'D/H/chi' : Item("This is the file 'chi'.\n"),
'D/H/psi' : Item("New content"),
'D/H/omega' : Item("New content"),
})
expected_skip = wc.State(A_path, { })
svntest.actions.run_and_verify_merge(A_path, None, None,
sbox.repo_url + '/A_COPY', None,
expected_output,
expected_mergeinfo_output,
expected_elision_output,
expected_disk,
expected_status,
expected_skip,
[], None, None, None, None, True, True,
'--reintegrate', A_path)
def merge_file_with_space_in_its_path(sbox):
"merge a file with space in its path"
sbox.build()
wc_dir = sbox.wc_dir
some_dir = os.path.join(wc_dir, "some dir")
file1 = os.path.join(some_dir, "file1")
file2 = os.path.join(some_dir, "file2")
os.mkdir(some_dir)
svntest.main.file_append(file1, "Initial text in the file.\n")
svntest.main.run_svn(None, "add", some_dir)
svntest.actions.run_and_verify_svn(None, None, [],
"ci", "-m", "r2", wc_dir)
svntest.main.run_svn(None, "copy", file1, file2)
svntest.actions.run_and_verify_svn(None, None, [],
"ci", "-m", "r3", wc_dir)
svntest.main.file_append(file2, "Next line of text in the file.\n")
svntest.actions.run_and_verify_svn(None, None, [],
"ci", "-m", "r4", wc_dir)
target_url = sbox.repo_url + '/some%20dir/file2'
svntest.actions.run_and_verify_svn(None, None, [],
"merge", "--reintegrate", target_url,
file1)
@SkipUnless(server_has_mergeinfo)
def reintegrate_with_subtree_mergeinfo(sbox):
"merge --reintegrate with subtree mergeinfo"
sbox.build()
wc_dir = sbox.wc_dir
expected_disk, expected_status = set_up_branch(sbox, False, 3)
gamma_COPY_3_path = os.path.join(wc_dir, "A_COPY_3", "D", "gamma")
D_path = os.path.join(wc_dir, "A", "D")
gamma_path = os.path.join(wc_dir, "A", "D", "gamma")
mu_COPY_2_path = os.path.join(wc_dir, "A_COPY_2", "mu")
mu_path = os.path.join(wc_dir, "A", "mu")
mu_COPY_path = os.path.join(wc_dir, "A_COPY", "mu")
A_COPY_path = os.path.join(wc_dir, "A_COPY")
D_COPY_path = os.path.join(wc_dir, "A_COPY")
beta_COPY_path = os.path.join(wc_dir, "A_COPY", "B", "E", "beta")
gamma_COPY_path = os.path.join(wc_dir, "A_COPY", "D", "gamma")
gamma_moved_COPY_path = os.path.join(wc_dir, "A_COPY", "D", "gamma_moved")
gamma_moved_path = os.path.join(wc_dir, "A", "D", "gamma_moved")
rho_COPY_path = os.path.join(wc_dir, "A_COPY", "D", "G", "rho")
omega_COPY_path = os.path.join(wc_dir, "A_COPY", "D", "H", "omega")
psi_COPY_path = os.path.join(wc_dir, "A_COPY", "D", "H", "psi")
D_COPY_path = os.path.join(wc_dir, "A_COPY", "D")
alpha_COPY_path = os.path.join(wc_dir, "A_COPY", "B", "E", "alpha")
A_path = os.path.join(wc_dir, "A")
svntest.main.file_write(gamma_COPY_3_path, "New content")
expected_output = wc.State(wc_dir, {'A_COPY_3/D/gamma' : Item(verb='Sending')})
expected_status.tweak('A_COPY_3/D/gamma', wc_rev=9)
svntest.actions.run_and_verify_commit(wc_dir, expected_output,
expected_status, None, wc_dir)
expected_disk.tweak('A_COPY_3/D/gamma', contents="New content")
svntest.actions.run_and_verify_svn(None, exp_noop_up_out(9), [], 'up',
wc_dir)
expected_status.tweak(wc_rev=9)
svntest.actions.run_and_verify_svn(
None,
expected_merge_output([[9]],
['U ' + gamma_path + '\n',
' U ' + D_path + '\n',]),
[], 'merge', '-c9', sbox.repo_url + '/A_COPY_3/D', D_path)
expected_output = wc.State(wc_dir,
{'A/D' : Item(verb='Sending'),
'A/D/gamma' : Item(verb='Sending')})
expected_status.tweak('A/D', 'A/D/gamma', wc_rev=10)
svntest.actions.run_and_verify_commit(wc_dir, expected_output,
expected_status, None, wc_dir)
expected_disk.tweak('A/D/gamma', contents="New content")
expected_disk.tweak('A/D', props={SVN_PROP_MERGEINFO : '/A_COPY_3/D:9'})
svntest.main.file_write(mu_COPY_2_path, "New content")
expected_output = wc.State(wc_dir, {'A_COPY_2/mu' : Item(verb='Sending')})
expected_status.tweak('A_COPY_2/mu', wc_rev=11)
svntest.actions.run_and_verify_commit(wc_dir, expected_output,
expected_status, None, wc_dir)
expected_disk.tweak('A_COPY_2/mu', contents="New content")
svntest.actions.run_and_verify_svn(None, exp_noop_up_out(11), [], 'up',
wc_dir)
expected_status.tweak(wc_rev=11)
svntest.actions.run_and_verify_svn(
None,
expected_merge_output([[11]],
['U ' + mu_COPY_path + '\n',
' U ' + mu_COPY_path + '\n',]),
[], 'merge', '-c11', sbox.repo_url + '/A_COPY_2/mu', mu_COPY_path)
expected_output = wc.State(wc_dir,
{'A_COPY/mu' : Item(verb='Sending')})
expected_status.tweak('A_COPY/mu', wc_rev=12)
svntest.actions.run_and_verify_commit(wc_dir, expected_output,
expected_status, None, wc_dir)
expected_disk.tweak('A_COPY/mu', contents="New content")
svntest.actions.run_and_verify_svn(None, exp_noop_up_out(12), [], 'up',
wc_dir)
expected_status.tweak(wc_rev=12)
svntest.actions.run_and_verify_svn(
None,
expected_merge_output([[2,12]],
['U ' + beta_COPY_path + '\n',
'U ' + gamma_COPY_path + '\n',
'U ' + rho_COPY_path + '\n',
'U ' + omega_COPY_path + '\n',
'U ' + psi_COPY_path + '\n',
' U ' + A_COPY_path + '\n',
' U ' + D_COPY_path + '\n',
' G ' + D_COPY_path + '\n',]),
[], 'merge', sbox.repo_url + '/A', A_COPY_path)
expected_output = wc.State(wc_dir,
{'A_COPY' : Item(verb='Sending'),
'A_COPY/B/E/beta' : Item(verb='Sending'),
'A_COPY/D' : Item(verb='Sending'),
'A_COPY/D/G/rho' : Item(verb='Sending'),
'A_COPY/D/H/omega' : Item(verb='Sending'),
'A_COPY/D/H/psi' : Item(verb='Sending'),
'A_COPY/D/gamma' : Item(verb='Sending')})
expected_status.tweak('A_COPY',
'A_COPY/B/E/beta',
'A_COPY/D',
'A_COPY/D/G/rho',
'A_COPY/D/H/omega',
'A_COPY/D/H/psi',
'A_COPY/D/gamma',
wc_rev=13)
svntest.actions.run_and_verify_commit(wc_dir, expected_output,
expected_status, None, wc_dir)
expected_disk.tweak('A_COPY/B/E/beta',
'A_COPY/D',
'A_COPY/D/G/rho',
'A_COPY/D/H/omega',
'A_COPY/D/H/psi',
'A_COPY/D/gamma',
contents="New content")
expected_disk.tweak('A_COPY', props={SVN_PROP_MERGEINFO : '/A:2-12'})
expected_disk.tweak('A_COPY/D',
props={SVN_PROP_MERGEINFO : '/A/D:2-12\n/A_COPY_3/D:9\n'})
svntest.main.file_write(alpha_COPY_path, "New content")
expected_output = wc.State(wc_dir, {'A_COPY/B/E/alpha' : Item(verb='Sending')})
expected_status.tweak('A_COPY/B/E/alpha', wc_rev=14)
svntest.actions.run_and_verify_commit(wc_dir, expected_output,
expected_status, None, wc_dir)
expected_disk.tweak('A_COPY/B/E/alpha', contents="New content")
svntest.actions.run_and_verify_svn(None, exp_noop_up_out(14), [], 'up',
wc_dir)
expected_status.tweak(wc_rev=14)
expected_output = wc.State(A_path, {
'B/E/alpha' : Item(status='U '),
'mu' : Item(status='UU'),
'D' : Item(status=' U'),
})
expected_mergeinfo_output = wc.State(A_path, {
'' : Item(status=' U'),
'mu' : Item(status=' G'),
'D' : Item(status=' U'),
})
expected_elision_output = wc.State(A_path, {
})
expected_A_status = wc.State(A_path, {
'' : Item(status=' M'),
'B' : Item(status=' '),
'mu' : Item(status='MM'),
'B/E' : Item(status=' '),
'B/E/alpha' : Item(status='M '),
'B/E/beta' : Item(status=' '),
'B/lambda' : Item(status=' '),
'B/F' : Item(status=' '),
'C' : Item(status=' '),
'D' : Item(status=' M'),
'D/G' : Item(status=' '),
'D/G/pi' : Item(status=' '),
'D/G/rho' : Item(status=' '),
'D/G/tau' : Item(status=' '),
'D/gamma' : Item(status=' '),
'D/H' : Item(status=' '),
'D/H/chi' : Item(status=' '),
'D/H/psi' : Item(status=' '),
'D/H/omega' : Item(status=' '),
})
expected_A_status.tweak(wc_rev=14)
expected_A_disk = wc.State('', {
'' : Item(props={SVN_PROP_MERGEINFO : '/A_COPY:2-14'}),
'B' : Item(),
'mu' : Item("New content",
props={SVN_PROP_MERGEINFO :
'/A_COPY/mu:2-14\n/A_COPY_2/mu:11'}),
'B/E' : Item(),
'B/E/alpha' : Item("New content"),
'B/E/beta' : Item("New content"),
'B/lambda' : Item("This is the file 'lambda'.\n"),
'B/F' : Item(),
'C' : Item(),
'D' : Item(props=
{SVN_PROP_MERGEINFO : '/A_COPY/D:2-14\n/A_COPY_3/D:9'}),
'D/G' : Item(),
'D/G/pi' : Item("This is the file 'pi'.\n"),
'D/G/rho' : Item("New content"),
'D/G/tau' : Item("This is the file 'tau'.\n"),
'D/gamma' : Item("New content"),
'D/H' : Item(),
'D/H/chi' : Item("This is the file 'chi'.\n"),
'D/H/psi' : Item("New content"),
'D/H/omega' : Item("New content"),
})
expected_A_skip = wc.State(A_COPY_path, {})
svntest.actions.run_and_verify_merge(A_path, None, None,
sbox.repo_url + '/A_COPY', None,
expected_output,
expected_mergeinfo_output,
expected_elision_output,
expected_A_disk,
expected_A_status,
expected_A_skip,
None, None, None, None,
None, 1, 1, "--reintegrate", A_path)
svntest.actions.run_and_verify_svn(None, None, [],
'revert', '-R', wc_dir)
svntest.actions.run_and_verify_svn(
None,
expected_merge_output([[-8]],
['U ' + omega_COPY_path + '\n',
' U ' + D_COPY_path + '\n',]),
[], 'merge', '-c-8', sbox.repo_url + '/A/D', D_COPY_path)
expected_output = wc.State(wc_dir,
{'A_COPY/D' : Item(verb='Sending'),
'A_COPY/D/H/omega' : Item(verb='Sending')})
expected_status.tweak('A_COPY/D', 'A_COPY/D/H/omega', wc_rev=15)
svntest.actions.run_and_verify_commit(wc_dir, expected_output,
expected_status, None, wc_dir)
exit_code, out, err = svntest.actions.run_and_verify_svn(
None, [], svntest.verify.AnyOutput,
'merge', '--reintegrate', sbox.repo_url + '/A_COPY', A_path)
svntest.verify.verify_outputs("Reintegrate failed but not "
"in the way expected",
err, None,
"(svn: E195016: Reintegrate can only be used if "
"revisions 2 through 15 were previously "
"merged from .*/A to the reintegrate source, "
"but this is not the case:\n)"
"|( A_COPY/D\n)"
"|( Missing ranges: /A/D:8\n)"
"|( A_COPY/mu\n)"
"|( Missing ranges: /A/mu:2-12\n)"
"|(\n)"
"|(.*apr_err.*)", None,
True)
svntest.actions.run_and_verify_svn(None, None,[], 'move',
sbox.repo_url + '/A/D/gamma',
sbox.repo_url + '/A/D/gamma_moved',
'-m', 'REPOS-to-REPOS move'
)
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
expected_disk.remove('A/D/gamma')
expected_disk.add({
'A/D/gamma_moved' : Item(props={SVN_PROP_MERGEINFO: '/A_COPY_3/D/gamma:9'},
contents="New content")
})
expected_status.tweak(wc_rev=16)
expected_status.remove('A/D/gamma')
expected_status.add({'A/D/gamma_moved' : Item(status=' ', wc_rev=16)})
svntest.actions.run_and_verify_svn(
None,
expected_merge_output([[8], [13,16], [2,16]],
['U ' + omega_COPY_path + '\n',
'A ' + gamma_moved_COPY_path + '\n',
'D ' + gamma_COPY_path + '\n',
' U ' + A_COPY_path + '\n',
' U ' + D_COPY_path + '\n',
' U ' + gamma_moved_COPY_path + '\n']),
[], 'merge', sbox.repo_url + '/A', A_COPY_path)
expected_output = wc.State(
wc_dir,
{'A_COPY' : Item(verb='Sending'), 'A_COPY/D' : Item(verb='Sending'), 'A_COPY/D/gamma' : Item(verb='Deleting'),
'A_COPY/D/gamma_moved' : Item(verb='Adding'),
'A_COPY/D/H/omega' : Item(verb='Sending'), })
expected_status.remove('A_COPY/D/gamma')
expected_status.tweak('A_COPY',
'A_COPY/D',
'A_COPY/D/H/omega',
wc_rev=17)
expected_status.add({'A_COPY/D/gamma_moved' : Item(status=' ', wc_rev=17)})
svntest.actions.run_and_verify_commit(wc_dir, expected_output,
expected_status, None, wc_dir)
expected_disk.remove('A_COPY/D/gamma')
expected_disk.add({
'A/D/gamma_moved' : Item(props={SVN_PROP_MERGEINFO: '/A_COPY_3/D/gamma:9'},
contents="New content")
})
svntest.main.file_write(gamma_moved_path, "Even newer content")
expected_output = wc.State(wc_dir, {'A/D/gamma_moved' : Item(verb='Sending')})
expected_status.tweak('A/D/gamma_moved', wc_rev=18)
svntest.actions.run_and_verify_commit(wc_dir, expected_output,
expected_status, None, wc_dir)
svntest.actions.run_and_verify_svn(
None,
expected_merge_output([[17,18], [2,18]],
['U ' + gamma_moved_COPY_path + '\n',
' U ' + A_COPY_path + '\n',
' U ' + D_COPY_path + '\n',
' U ' + gamma_moved_COPY_path + '\n']),
[], 'merge', '--allow-mixed-revisions', sbox.repo_url + '/A', A_COPY_path)
expected_output = wc.State(
wc_dir,
{'A_COPY' : Item(verb='Sending'), 'A_COPY/D' : Item(verb='Sending'), 'A_COPY/D/gamma_moved' : Item(verb='Sending'), })
expected_status.tweak('A_COPY',
'A_COPY/D',
'A_COPY/D/gamma_moved',
wc_rev=19)
svntest.actions.run_and_verify_commit(wc_dir, expected_output,
expected_status, None, wc_dir)
svntest.actions.run_and_verify_svn(None, exp_noop_up_out(19), [], 'up',
wc_dir)
expected_output = wc.State(A_path, {
'B/E/alpha' : Item(status='U '),
'mu' : Item(status='UU'),
'D' : Item(status=' U'),
'D/gamma_moved' : Item(status=' U'),
})
expected_mergeinfo_output = wc.State(A_path, {
'' : Item(status=' U'),
'mu' : Item(status=' G'),
'D' : Item(status=' U'),
'D/gamma_moved' : Item(status=' U'),
})
expected_elision_output = wc.State(A_path, {
})
expected_A_status = wc.State(A_path, {
'' : Item(status=' M'),
'B' : Item(status=' '),
'mu' : Item(status='MM'),
'B/E' : Item(status=' '),
'B/E/alpha' : Item(status='M '),
'B/E/beta' : Item(status=' '),
'B/lambda' : Item(status=' '),
'B/F' : Item(status=' '),
'C' : Item(status=' '),
'D' : Item(status=' M'),
'D/G' : Item(status=' '),
'D/G/pi' : Item(status=' '),
'D/G/rho' : Item(status=' '),
'D/G/tau' : Item(status=' '),
'D/gamma_moved' : Item(status=' M'),
'D/H' : Item(status=' '),
'D/H/chi' : Item(status=' '),
'D/H/psi' : Item(status=' '),
'D/H/omega' : Item(status=' '),
})
expected_A_status.tweak(wc_rev=19)
expected_A_disk = wc.State('', {
'' : Item(props={SVN_PROP_MERGEINFO : '/A_COPY:2-19'}),
'B' : Item(),
'mu' : Item("New content",
props={SVN_PROP_MERGEINFO :
'/A_COPY/mu:2-19\n/A_COPY_2/mu:11'}),
'B/E' : Item(),
'B/E/alpha' : Item("New content"),
'B/E/beta' : Item("New content"),
'B/lambda' : Item("This is the file 'lambda'.\n"),
'B/F' : Item(),
'C' : Item(),
'D' : Item(props={SVN_PROP_MERGEINFO :
'/A_COPY/D:2-19\n/A_COPY_3/D:9'}),
'D/G' : Item(),
'D/G/pi' : Item("This is the file 'pi'.\n"),
'D/G/rho' : Item("New content"),
'D/G/tau' : Item("This is the file 'tau'.\n"),
'D/gamma_moved' : Item(
"Even newer content", props={SVN_PROP_MERGEINFO :
'/A_COPY/D/gamma_moved:17-19\n'
'/A_COPY_3/D/gamma:9'}),
'D/H' : Item(),
'D/H/chi' : Item("This is the file 'chi'.\n"),
'D/H/psi' : Item("New content"),
'D/H/omega' : Item("New content"),
})
expected_A_skip = wc.State(A_COPY_path, {})
svntest.actions.run_and_verify_merge(A_path, None, None,
sbox.repo_url + '/A_COPY', None,
expected_output,
expected_mergeinfo_output,
expected_elision_output,
expected_A_disk,
expected_A_status,
expected_A_skip,
None, None, None, None,
None, 1, 1, "--reintegrate", A_path)
@SkipUnless(server_has_mergeinfo)
def multiple_reintegrates_from_the_same_branch(sbox):
"multiple reintegrates create self-referential"
sbox.build()
wc_dir = sbox.wc_dir
expected_disk, expected_status = set_up_branch(sbox)
A_path = os.path.join(wc_dir, "A")
mu_path = os.path.join(wc_dir, "A", "mu")
A_COPY_path = os.path.join(wc_dir, "A_COPY")
psi_COPY_path = os.path.join(wc_dir, "A_COPY", "D", "H", "psi")
Feature_branch_path = os.path.join(wc_dir, "A_FEATURE_BRANCH")
Feature_beta_path = os.path.join(wc_dir, "A_FEATURE_BRANCH", "B", "E",
"beta")
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
svntest.actions.run_and_verify_svn(None, None, [],
'copy', A_path, Feature_branch_path)
svntest.actions.run_and_verify_svn(None, None, [],
'ci', '-m', 'Make a feature branch',
wc_dir)
svntest.main.file_write(mu_path, "New trunk content.\n")
svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
"A text change under 'A'",
wc_dir)
svntest.main.file_write(Feature_beta_path, "New branch content.\n")
svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
"A text change on the feature branch",
wc_dir)
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
svntest.actions.run_and_verify_svn(None, None, [], 'merge',
sbox.repo_url + '/A',
Feature_branch_path)
svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
"Sync merge 'A' to feature branch",
wc_dir)
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
svntest.actions.run_and_verify_svn(None, None, [], 'merge', '--reintegrate',
sbox.repo_url + '/A_FEATURE_BRANCH',
A_path)
svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
"Reintegrate feature branch back to 'A'",
wc_dir)
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
svntest.actions.run_and_verify_svn(None, None, [], 'merge',
'--record-only',
sbox.repo_url + '/A',
Feature_branch_path)
svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
"Sync merge 'A' to feature branch",
wc_dir)
svntest.main.file_write(Feature_beta_path, "Even newer branch content.\n")
svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
"Different text on the feature branch",
wc_dir)
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
svntest.actions.run_and_verify_svn(None, None, [], 'merge',
sbox.repo_url + '/A',
Feature_branch_path)
svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
"2nd Sync merge 'A' to feature branch",
wc_dir)
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
expected_output = wc.State(A_path, {
'B/E/beta' : Item(status='U '),
})
expected_mergeinfo_output = wc.State(A_path, {
'' : Item(status=' U'),
})
expected_elision_output = wc.State(A_path, {
})
expected_status = wc.State(A_path, {
'' : Item(status=' M'),
'B' : Item(status=' '),
'mu' : Item(status=' '),
'B/E' : Item(status=' '),
'B/E/alpha' : Item(status=' '),
'B/E/beta' : Item(status='M '),
'B/lambda' : Item(status=' '),
'B/F' : Item(status=' '),
'C' : Item(status=' '),
'D' : Item(status=' '),
'D/G' : Item(status=' '),
'D/G/pi' : Item(status=' '),
'D/G/rho' : Item(status=' '),
'D/G/tau' : Item(status=' '),
'D/gamma' : Item(status=' '),
'D/H' : Item(status=' '),
'D/H/chi' : Item(status=' '),
'D/H/psi' : Item(status=' '),
'D/H/omega' : Item(status=' '),
})
expected_status.tweak(wc_rev=14)
expected_disk = wc.State('', {
'' : Item(props={SVN_PROP_MERGEINFO :
'/A_FEATURE_BRANCH:7-14'}),
'B' : Item(),
'mu' : Item("New trunk content.\n"),
'B/E' : Item(),
'B/E/alpha' : Item("This is the file 'alpha'.\n"),
'B/E/beta' : Item("Even newer branch content.\n"),
'B/lambda' : Item("This is the file 'lambda'.\n"),
'B/F' : Item(),
'C' : Item(),
'D' : Item(),
'D/G' : Item(),
'D/G/pi' : Item("This is the file 'pi'.\n"),
'D/G/rho' : Item("New content"),
'D/G/tau' : Item("This is the file 'tau'.\n"),
'D/gamma' : Item("This is the file 'gamma'.\n"),
'D/H' : Item(),
'D/H/chi' : Item("This is the file 'chi'.\n"),
'D/H/psi' : Item("New content"),
'D/H/omega' : Item("New content"),
})
expected_skip = wc.State(A_path, { })
svntest.actions.run_and_verify_merge(A_path, None, None,
sbox.repo_url + '/A_FEATURE_BRANCH',
None,
expected_output,
expected_mergeinfo_output,
expected_elision_output,
expected_disk,
expected_status,
expected_skip,
None, None, None, None,
None, 1, 1, '--reintegrate', A_path)
svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
"2nd Reintegrate feature branch back to 'A'",
wc_dir)
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
svntest.actions.run_and_verify_svn(None, None, [], 'merge', '-r3:HEAD',
sbox.repo_url + '/A',
A_COPY_path)
svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
"Merge -r3:HEAD from 'A' to 'A_COPY'",
wc_dir)
svntest.actions.run_and_verify_svn(
None,
expected_merge_output([[2,3],[2,16]],
['U ' + psi_COPY_path + '\n',
' U ' + A_COPY_path + '\n',]),
[], 'merge', '--allow-mixed-revisions', sbox.repo_url + '/A', A_COPY_path)
@Issue(3591)
def reintegrate_with_self_referential_mergeinfo(sbox):
"source has target's history as explicit mergeinfo"
sbox.build()
wc_dir = sbox.wc_dir
wc_disk, wc_status = set_up_branch(sbox, nbr_of_branches=0)
A_path = os.path.join(wc_dir, "A")
A2_path = os.path.join(wc_dir, "A2")
A2_B_path = os.path.join(wc_dir, "A2", "B")
A2_1_path = os.path.join(wc_dir, "A2.1")
A2_1_mu_path = os.path.join(wc_dir, "A2.1", "mu")
svntest.actions.run_and_verify_svn(None, exp_noop_up_out(5), [],
'up', wc_dir)
svntest.actions.run_and_verify_svn(None, None, [],
'copy', A_path, A2_path)
svntest.actions.run_and_verify_svn(None, None, [],
'ps', 'svn:mergeinfo', '/A:3', A2_path)
svntest.actions.run_and_verify_svn(None, None, [],
'ps', 'svn:mergeinfo', '/A/B:4', A2_B_path)
svntest.actions.run_and_verify_svn(
None, None, [], 'ci', '-m',
'copy A to A2 and set some self-referential mergeinfo on the latter.',
wc_dir)
svntest.actions.run_and_verify_svn(None, None, [],
'copy', A2_path, A2_1_path)
svntest.actions.run_and_verify_svn(None, None, [], 'ci',
'-m', 'copy A2to A2.1.', wc_dir)
svntest.main.file_write(A2_1_mu_path, 'New A2.1 stuff')
svntest.actions.run_and_verify_svn(None, None, [], 'ci',
'-m', 'Work done on the A2.1 branch.',
wc_dir)
svntest.actions.run_and_verify_svn(None, exp_noop_up_out(8), [],
'up', wc_dir)
expected_output = wc.State(A2_path, {
'mu' : Item(status='U '),
})
expected_mergeinfo_output = wc.State(A2_path, {
'' : Item(status=' U'),
})
expected_elision_output = wc.State(A2_path, {
})
expected_status = wc.State(A2_path, {
'' : Item(status=' M'),
'B' : Item(status=' '),
'mu' : Item(status='M '),
'B/E' : Item(status=' '),
'B/E/alpha' : Item(status=' '),
'B/E/beta' : Item(status=' '),
'B/lambda' : Item(status=' '),
'B/F' : Item(status=' '),
'C' : Item(status=' '),
'D' : Item(status=' '),
'D/G' : Item(status=' '),
'D/G/pi' : Item(status=' '),
'D/G/rho' : Item(status=' '),
'D/G/tau' : Item(status=' '),
'D/gamma' : Item(status=' '),
'D/H' : Item(status=' '),
'D/H/chi' : Item(status=' '),
'D/H/psi' : Item(status=' '),
'D/H/omega' : Item(status=' '),
})
expected_status.tweak(wc_rev=8)
expected_disk = wc.State('', {
'' : Item(props={SVN_PROP_MERGEINFO : '/A:3\n/A2.1:7-8'}),
'B' : Item(props={SVN_PROP_MERGEINFO : '/A/B:4'}),
'mu' : Item("New A2.1 stuff"),
'B/E' : Item(),
'B/E/alpha' : Item("This is the file 'alpha'.\n"),
'B/E/beta' : Item("New content"),
'B/lambda' : Item("This is the file 'lambda'.\n"),
'B/F' : Item(),
'C' : Item(),
'D' : Item(),
'D/G' : Item(),
'D/G/pi' : Item("This is the file 'pi'.\n"),
'D/G/rho' : Item("New content"),
'D/G/tau' : Item("This is the file 'tau'.\n"),
'D/gamma' : Item("This is the file 'gamma'.\n"),
'D/H' : Item(),
'D/H/chi' : Item("This is the file 'chi'.\n"),
'D/H/psi' : Item("New content"),
'D/H/omega' : Item("New content"),
})
expected_skip = wc.State(A2_path, { })
svntest.actions.run_and_verify_merge(A2_path, None, None,
sbox.repo_url + '/A2.1', None,
expected_output,
expected_mergeinfo_output,
expected_elision_output,
expected_disk,
expected_status,
expected_skip,
None, None, None, None,
None, 1, 0, '--reintegrate', A2_path)
@Issue(3577)
def reintegrate_with_subtree_merges(sbox):
"reintegrate with prior subtree merges to source"
sbox.build()
wc_dir = sbox.wc_dir
expected_disk, expected_status = set_up_branch(sbox)
A_path = os.path.join(wc_dir, "A")
mu_COPY_path = os.path.join(wc_dir, "A_COPY", "mu")
A_COPY_path = os.path.join(wc_dir, "A_COPY")
B_COPY_path = os.path.join(wc_dir, "A_COPY", "B")
rho_COPY_path = os.path.join(wc_dir, "A_COPY", "D", "G", "rho")
H_COPY_path = os.path.join(wc_dir, "A_COPY", "D", "H")
svntest.main.file_write(mu_COPY_path, "branch work")
svntest.main.run_svn(None, 'commit', '-m',
'Some work on the A_COPY branch', wc_dir)
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
svntest.actions.run_and_verify_svn(None, None, [], 'merge', '-c5',
sbox.repo_url + '/A/B',
B_COPY_path)
svntest.actions.run_and_verify_svn(None, None, [], 'merge', '-c4',
sbox.repo_url + '/A/D/G/rho',
rho_COPY_path)
svntest.actions.run_and_verify_svn(None, None, [], 'merge', '-c3',
sbox.repo_url + '/A/D/H',
H_COPY_path)
svntest.actions.run_and_verify_svn(None, None, [], 'merge', '-c6',
sbox.repo_url + '/A',
A_COPY_path)
svntest.actions.run_and_verify_svn(None, None, [], 'commit', '-m',
'Merge everything from A to A_COPY',
wc_dir)
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
expected_output = wc.State(A_path, {
'mu' : Item(status='U '),
})
expected_mergeinfo_output = wc.State(A_path, {
'' : Item(status=' G'),
})
expected_elision_output = wc.State(A_path, {
})
expected_A_status = wc.State(A_path, {
'' : Item(status=' M'),
'B' : Item(status=' '),
'mu' : Item(status='M '),
'B/E' : Item(status=' '),
'B/E/alpha' : Item(status=' '),
'B/E/beta' : Item(status=' '),
'B/lambda' : Item(status=' '),
'B/F' : Item(status=' '),
'C' : Item(status=' '),
'D' : Item(status=' '),
'D/G' : Item(status=' '),
'D/G/pi' : Item(status=' '),
'D/G/rho' : Item(status=' '),
'D/G/tau' : Item(status=' '),
'D/gamma' : Item(status=' '),
'D/H' : Item(status=' '),
'D/H/chi' : Item(status=' '),
'D/H/psi' : Item(status=' '),
'D/H/omega' : Item(status=' '),
})
expected_A_status.tweak(wc_rev=8)
expected_A_disk = wc.State('', {
'' : Item(props={SVN_PROP_MERGEINFO : '/A_COPY:2-8'}),
'B' : Item(),
'mu' : Item("branch work"),
'B/E' : Item(),
'B/E/alpha' : Item("This is the file 'alpha'.\n"),
'B/E/beta' : Item("New content"),
'B/lambda' : Item("This is the file 'lambda'.\n"),
'B/F' : Item(),
'C' : Item(),
'D' : Item(),
'D/G' : Item(),
'D/G/pi' : Item("This is the file 'pi'.\n"),
'D/G/rho' : Item("New content"),
'D/G/tau' : Item("This is the file 'tau'.\n"),
'D/gamma' : Item("This is the file 'gamma'.\n"),
'D/H' : Item(),
'D/H/chi' : Item("This is the file 'chi'.\n"),
'D/H/psi' : Item("New content"),
'D/H/omega' : Item("New content"),
})
expected_A_skip = wc.State(A_COPY_path, {})
svntest.actions.run_and_verify_merge(A_path, None, None,
sbox.repo_url + '/A_COPY', None,
expected_output,
expected_mergeinfo_output,
expected_elision_output,
expected_A_disk,
expected_A_status,
expected_A_skip,
None, None, None, None,
None, 1, 1, "--reintegrate", A_path)
@Issue(3654)
def added_subtrees_with_mergeinfo_break_reintegrate(sbox):
"added subtrees with mergeinfo break reintegrate"
sbox.build()
wc_dir = sbox.wc_dir
A_path = os.path.join(wc_dir, "A")
nu_path = os.path.join(wc_dir, "A", "C", "nu")
mu_path = os.path.join(wc_dir, "A", "mu")
A_COPY_path = os.path.join(wc_dir, "A_COPY")
lambda_COPY_path = os.path.join(wc_dir, "A_COPY", "B", "lambda")
A_COPY_2_path = os.path.join(wc_dir, "A_COPY_2")
nu_COPY_2_path = os.path.join(wc_dir, "A_COPY_2", "C", "nu")
wc_disk, wc_status = set_up_branch(sbox, nbr_of_branches=2)
svntest.main.file_write(nu_COPY_2_path, "This is the file 'nu'.\n")
svntest.actions.run_and_verify_svn(None, None, [], 'add', nu_COPY_2_path)
svntest.actions.run_and_verify_svn(None, None, [], 'ci',
'-m', 'Add new file in A_COPY_2 branch',
wc_dir)
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
svntest.actions.run_and_verify_svn(None, svntest.verify.AnyOutput, [],
'merge', '-c', '8',
sbox.repo_url + '/A_COPY_2',
A_path)
svntest.actions.run_and_verify_svn(None, None, [], 'ci',
'-m', 'Merge r8 from A_COPY_2 to A.',
wc_dir)
svntest.main.file_write(nu_COPY_2_path, "A_COPY_2 edit to file 'nu'.\n")
svntest.actions.run_and_verify_svn(None, None, [], 'ci',
'-m', 'Edit new file on A_COPY_2 branch',
wc_dir)
svntest.actions.run_and_verify_svn(None, svntest.verify.AnyOutput, [],
'merge', '-c', '10',
sbox.repo_url + '/A_COPY_2/C/nu',
nu_path)
svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
'Merge r8 from A_COPY_2/C/nu to A/C/nu.',
wc_dir)
svntest.main.file_write(mu_path, "mu edits on A_COPY.\n")
svntest.actions.run_and_verify_svn(None, None, [], 'ci',
'-m', 'Work on A_COPY branch.',
wc_dir)
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
svntest.actions.run_and_verify_svn(None, svntest.verify.AnyOutput, [],
'merge', sbox.repo_url + '/A', A_COPY_path)
svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
'Prep for reintegrate: Sync A to A_COPY.',
wc_dir)
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
svntest.actions.run_and_verify_svn(None, svntest.verify.AnyOutput, [],
'merge', '--reintegrate',
sbox.repo_url + '/A_COPY', A_path)
svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
'Reintegrate A_COPY to A.',
wc_dir)
svntest.actions.run_and_verify_svn(None, svntest.verify.AnyOutput, [],
'delete', A_COPY_path)
svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
'Delete A_COPY branch', wc_dir)
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
svntest.actions.run_and_verify_svn(None, svntest.verify.AnyOutput, [],
'copy', A_path, A_COPY_path)
svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
'Create new A_COPY branch from A', wc_dir)
svntest.main.file_write(nu_path, "Trunk work on nu.\n")
svntest.main.file_write(lambda_COPY_path, "lambda edit on A_COPY.\n")
svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
'Unrelated edits on A and A_COPY branch.',
wc_dir)
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
svntest.actions.run_and_verify_svn(None, svntest.verify.AnyOutput, [],
'merge', sbox.repo_url + '/A', A_COPY_path)
svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
'Prep for reintegrate: Sync A to A_COPY.',
wc_dir)
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
expected_output = wc.State(A_path, {
'' : Item(status=' U'),
'B/lambda' : Item(status='U '),
'C/nu' : Item(status=' U'),
})
expected_mergeinfo_output = wc.State(A_path, {
'' : Item(status=' U'),
'C/nu' : Item(status=' U'),
})
expected_elision_output = wc.State(A_path, {
})
expected_status = wc.State(A_path, {
'' : Item(status=' M'),
'B' : Item(status=' '),
'mu' : Item(status=' '),
'B/E' : Item(status=' '),
'B/E/alpha' : Item(status=' '),
'B/E/beta' : Item(status=' '),
'B/lambda' : Item(status='M '),
'B/F' : Item(status=' '),
'C' : Item(status=' '),
'C/nu' : Item(status=' M'),
'D' : Item(status=' '),
'D/G' : Item(status=' '),
'D/G/pi' : Item(status=' '),
'D/G/rho' : Item(status=' '),
'D/G/tau' : Item(status=' '),
'D/gamma' : Item(status=' '),
'D/H' : Item(status=' '),
'D/H/chi' : Item(status=' '),
'D/H/psi' : Item(status=' '),
'D/H/omega' : Item(status=' '),
})
expected_status.tweak(wc_rev=18)
expected_disk = wc.State('', {
'' : Item(props={SVN_PROP_MERGEINFO :
'/A_COPY:2-13,16-18\n'
'/A_COPY_2:8'}), 'B' : Item(),
'mu' : Item("mu edits on A_COPY.\n"), 'B/E' : Item(),
'B/E/alpha' : Item("This is the file 'alpha'.\n"),
'B/E/beta' : Item("New content"),
'B/lambda' : Item("lambda edit on A_COPY.\n"), 'B/F' : Item(),
'C' : Item(),
'C/nu' : Item("Trunk work on nu.\n",
props={SVN_PROP_MERGEINFO :
'/A_COPY/C/nu:13,16-18\n'
'/A_COPY_2/C/nu:10'}), 'D' : Item(),
'D/G' : Item(),
'D/G/pi' : Item("This is the file 'pi'.\n"),
'D/G/rho' : Item("New content"),
'D/G/tau' : Item("This is the file 'tau'.\n"),
'D/gamma' : Item("This is the file 'gamma'.\n"),
'D/H' : Item(),
'D/H/chi' : Item("This is the file 'chi'.\n"),
'D/H/psi' : Item("New content"),
'D/H/omega' : Item("New content"),
})
expected_skip = wc.State(A_COPY_path, {})
svntest.actions.run_and_verify_merge(A_path, None, None,
sbox.repo_url + '/A_COPY', None,
expected_output,
expected_mergeinfo_output,
expected_elision_output,
expected_disk,
expected_status,
expected_skip,
None, None, None, None,
None, 1, 1, "--reintegrate", A_path)
@Issue(3648)
def two_URL_merge_removes_valid_mergeinfo_from_target(sbox):
"2-URL merge removes valid mergeinfo from target"
sbox.build()
wc_dir = sbox.wc_dir
lambda_COPY_path = os.path.join(wc_dir, "A_COPY", "B", "lambda")
mu_path = os.path.join(wc_dir, "A", "mu")
A_COPY_path = os.path.join(wc_dir, "A_COPY")
A_COPY_2_path = os.path.join(wc_dir, "A_COPY_2")
wc_disk, wc_status = set_up_branch(sbox, nbr_of_branches=2)
svntest.main.file_write(lambda_COPY_path, "Edit on 'branch 1'.\n")
svntest.actions.run_and_verify_svn(None, None, [], 'ci',
'-m', "Work on 'branch 1'.",
wc_dir)
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
svntest.actions.run_and_verify_svn(None, svntest.verify.AnyOutput, [],
'merge', sbox.repo_url + '/A', A_COPY_path)
svntest.actions.run_and_verify_svn(None, None, [], 'ci',
'-m', 'Sync A to A_COPY.',
wc_dir)
svntest.main.file_write(mu_path, "Edit on 'trunk'.\n")
svntest.actions.run_and_verify_svn(None, None, [], 'ci',
'-m', "Work on 'trunk'",
wc_dir)
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
svntest.actions.run_and_verify_svn(None, svntest.verify.AnyOutput, [],
'merge', sbox.repo_url + '/A',
A_COPY_2_path)
svntest.actions.run_and_verify_svn(None, None, [], 'ci',
'-m', 'Sync A to A_COPY_2.',
wc_dir)
svntest.actions.run_and_verify_svn(None,
[A_COPY_path + ' - /A:2-8\n'],
[], 'pg', SVN_PROP_MERGEINFO,
'-R', A_COPY_path)
svntest.actions.run_and_verify_svn(None,
[A_COPY_2_path + ' - /A:3-10\n'],
[], 'pg', SVN_PROP_MERGEINFO,
'-R', A_COPY_2_path)
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
expected_output = wc.State(A_COPY_2_path, {
'' : Item(status=' G'),
'B/lambda' : Item(status='U '),
})
expected_mergeinfo_output = wc.State(A_COPY_2_path, {
'' : Item(status=' U'),
})
expected_elision_output = wc.State(A_COPY_2_path, {
})
expected_status = wc.State(A_COPY_2_path, {
'' : Item(status=' M'),
'B' : Item(status=' '),
'mu' : Item(status=' '),
'B/E' : Item(status=' '),
'B/E/alpha' : Item(status=' '),
'B/E/beta' : Item(status=' '),
'B/lambda' : Item(status='M '),
'B/F' : Item(status=' '),
'C' : Item(status=' '),
'D' : Item(status=' '),
'D/G' : Item(status=' '),
'D/G/pi' : Item(status=' '),
'D/G/rho' : Item(status=' '),
'D/G/tau' : Item(status=' '),
'D/gamma' : Item(status=' '),
'D/H' : Item(status=' '),
'D/H/chi' : Item(status=' '),
'D/H/psi' : Item(status=' '),
'D/H/omega' : Item(status=' '),
})
expected_status.tweak(wc_rev=11)
expected_disk = wc.State('', {
'' : Item(props={SVN_PROP_MERGEINFO :
'/A:3-10\n/A_COPY:2-11'}),
'B' : Item(),
'mu' : Item("Edit on 'trunk'.\n"),
'B/E' : Item(),
'B/E/alpha' : Item("This is the file 'alpha'.\n"),
'B/E/beta' : Item("New content"),
'B/lambda' : Item("Edit on 'branch 1'.\n"),
'B/F' : Item(),
'C' : Item(),
'D' : Item(),
'D/G' : Item(),
'D/G/pi' : Item("This is the file 'pi'.\n"),
'D/G/rho' : Item("New content"),
'D/G/tau' : Item("This is the file 'tau'.\n"),
'D/gamma' : Item("This is the file 'gamma'.\n"),
'D/H' : Item(),
'D/H/chi' : Item("This is the file 'chi'.\n"),
'D/H/psi' : Item("New content"),
'D/H/omega' : Item("New content"),
})
expected_skip = wc.State(A_COPY_path, {})
svntest.actions.run_and_verify_merge(A_COPY_2_path, 8, 11,
sbox.repo_url + '/A',
sbox.repo_url + '/A_COPY',
expected_output,
expected_mergeinfo_output,
expected_elision_output,
expected_disk,
expected_status,
expected_skip,
None, None, None, None,
None, 1, 1)
@Issue(3867)
def reintegrate_creates_bogus_mergeinfo(sbox):
"reintegrate creates bogus mergeinfo"
sbox.build()
wc_dir=sbox.wc_dir
mu_path = os.path.join(sbox.wc_dir, "A", "mu")
lambda_path = os.path.join(sbox.wc_dir, "A", "B", "lambda")
alpha_path = os.path.join(sbox.wc_dir, "A", "B", "E", "alpha")
beta_path = os.path.join(sbox.wc_dir, "A", "B", "E", "beta")
A_path = os.path.join(sbox.wc_dir, "A")
A_path_1 = os.path.join(sbox.wc_dir, "A@1")
A_COPY_path = os.path.join(sbox.wc_dir, "A_COPY")
A_COPY_psi_path = os.path.join(sbox.wc_dir, "A_COPY", "D", "H", "psi")
A_COPY_url = sbox.repo_url + "/A_COPY"
svntest.main.file_write(mu_path, "New content.\n")
svntest.main.run_svn(None, "ci", "-m", "simple text edit", wc_dir)
svntest.main.file_write(lambda_path, "New content.\n")
svntest.main.run_svn(None, "ci", "-m", "simple text edit", wc_dir)
svntest.main.run_svn(None, "cp", A_path_1, A_COPY_path)
svntest.main.run_svn(None, "ci", "-m", "create a branch", wc_dir)
svntest.main.file_write(A_COPY_psi_path, "Branch edit.\n")
svntest.main.run_svn(None, "ci", "-m", "branch edit", wc_dir)
svntest.main.run_svn(None, "up", wc_dir)
svntest.main.run_svn(None, "merge", sbox.repo_url + "/A", A_COPY_path)
svntest.main.run_svn(None, "ci", "-m", "sync A_COPY with A", wc_dir)
svntest.main.run_svn(None, "up", wc_dir)
expected_output = wc.State(A_path, {
'D/H/psi' : Item(status='U '),
})
expected_mergeinfo_output = wc.State(A_path, {
'' : Item(status=' U'),
})
expected_elision_output = wc.State(A_path, {
})
expected_disk = wc.State('', {
'' : Item(props={SVN_PROP_MERGEINFO :
'/A_COPY:4-6'}),
'B' : Item(),
'mu' : Item("New content.\n"),
'B/E' : Item(),
'B/E/alpha' : Item("This is the file 'alpha'.\n"),
'B/E/beta' : Item("This is the file 'beta'.\n"),
'B/lambda' : Item("New content.\n"),
'B/F' : Item(),
'C' : Item(),
'D' : Item(),
'D/G' : Item(),
'D/G/pi' : Item("This is the file 'pi'.\n"),
'D/G/rho' : Item("This is the file 'rho'.\n"),
'D/G/tau' : Item("This is the file 'tau'.\n"),
'D/gamma' : Item("This is the file 'gamma'.\n"),
'D/H' : Item(),
'D/H/chi' : Item("This is the file 'chi'.\n"),
'D/H/psi' : Item("Branch edit.\n"),
'D/H/omega' : Item("This is the file 'omega'.\n"),
})
expected_skip = wc.State(A_COPY_path, {})
svntest.actions.run_and_verify_merge(A_path, None, None,
A_COPY_url, None,
expected_output,
expected_mergeinfo_output,
expected_elision_output,
expected_disk, None, expected_skip,
None, None, None, None, None,
1, 1, "--reintegrate", A_path)
@Issue(3957)
def no_source_subtree_mergeinfo(sbox):
"source without subtree mergeinfo"
sbox.build()
wc_dir=sbox.wc_dir
svntest.main.file_write(os.path.join(wc_dir, 'A', 'B', 'E', 'alpha'),
'AAA\n' +
'BBB\n' +
'CCC\n')
svntest.main.run_svn(None, 'commit', '-m', 'log message', wc_dir)
svntest.main.run_svn(None, 'update', wc_dir)
svntest.main.run_svn(None, 'copy',
os.path.join(wc_dir, 'A', 'B'),
os.path.join(wc_dir, 'A', 'B1'))
svntest.main.run_svn(None, 'commit', '-m', 'log message', wc_dir)
svntest.main.run_svn(None, 'copy',
os.path.join(wc_dir, 'A', 'B'),
os.path.join(wc_dir, 'A', 'B2'))
svntest.main.run_svn(None, 'commit', '-m', 'log message', wc_dir)
svntest.main.file_write(os.path.join(wc_dir, 'A', 'B', 'E', 'alpha'),
'AAAxx\n' +
'BBB\n' +
'CCC\n')
svntest.main.run_svn(None, 'commit', '-m', 'log message', wc_dir)
svntest.main.file_write(os.path.join(wc_dir, 'A', 'B1', 'E', 'alpha'),
'AAA\n' +
'BBBxx\n' +
'CCC\n')
svntest.main.run_svn(None, 'commit', '-m', 'log message', wc_dir)
svntest.main.file_write(os.path.join(wc_dir, 'A', 'B2', 'E', 'alpha'),
'AAA\n' +
'BBB\n' +
'CCCxx\n')
svntest.main.run_svn(None, 'commit', '-m', 'log message', wc_dir)
svntest.main.run_svn(None, 'update', wc_dir)
svntest.main.run_svn(None, 'merge', '^/A/B', os.path.join(wc_dir, 'A', 'B1'))
svntest.main.run_svn(None, 'commit', '-m', 'log message', wc_dir)
svntest.main.run_svn(None, 'update', wc_dir)
svntest.main.run_svn(None, 'merge', '--reintegrate',
'^/A/B1/E', os.path.join(wc_dir, 'A', 'B', 'E'))
svntest.main.run_svn(None, 'commit', '-m', 'log message', wc_dir)
svntest.main.run_svn(None, 'update', wc_dir)
svntest.main.run_svn(None, 'merge', '^/A/B', os.path.join(wc_dir, 'A', 'B2'))
svntest.main.run_svn(None, 'commit', '-m', 'log message', wc_dir)
svntest.main.run_svn(None, 'update', wc_dir)
svntest.main.run_svn(None, 'merge', '-r8:2',
'^/A/B1/E', os.path.join(wc_dir, 'A', 'B2', 'E'))
svntest.main.run_svn(None, 'commit', '-m', 'log message', wc_dir)
svntest.main.run_svn(None, 'update', wc_dir)
svntest.main.run_svn(None, 'merge', '^/A/B', os.path.join(wc_dir, 'A', 'B2'))
svntest.main.run_svn(None, 'commit', '-m', 'log message', wc_dir)
svntest.main.run_svn(None, 'update', wc_dir)
expected_output = wc.State(os.path.join(wc_dir, 'A', 'B'), {
'E' : Item(status=' U'),
'E/alpha' : Item(status='U '),
})
expected_mergeinfo = wc.State(os.path.join(wc_dir, 'A', 'B'), {
'' : Item(status=' U'),
})
expected_elision = wc.State(os.path.join(wc_dir, 'A', 'B'), {
})
expected_disk = wc.State('', {
'' : Item(props={SVN_PROP_MERGEINFO : '/A/B2:4-12'}),
'E' : Item(),
'E/alpha' : Item("AAA\n" +
"BBB\n" +
"CCCxx\n"),
'E/beta' : Item("This is the file 'beta'.\n"),
'F' : Item(),
'lambda' : Item("This is the file 'lambda'.\n"),
})
expected_skip = wc.State(os.path.join(wc_dir, 'A', 'B'), {
})
svntest.actions.run_and_verify_merge(os.path.join(wc_dir, 'A', 'B'),
None, None, '^/A/B2', None,
expected_output, expected_mergeinfo,
expected_elision, expected_disk,
None, expected_skip,
None, None, None, None, None,
1, 1, '--reintegrate',
os.path.join(wc_dir, 'A', 'B'))
@SkipUnless(server_has_mergeinfo)
@Issue(3961)
def reintegrate_replaced_source(sbox):
"reintegrate a replaced source branch"
sbox.build()
wc_dir = sbox.wc_dir
expected_disk, expected_status = set_up_branch(sbox)
A_path = os.path.join(sbox.wc_dir, "A")
A_COPY_path = os.path.join(sbox.wc_dir, "A_COPY")
beta_COPY_path = os.path.join(sbox.wc_dir, "A_COPY", "B", "E", "beta")
mu_COPY_path = os.path.join(sbox.wc_dir, "A_COPY", "mu")
svntest.main.run_svn(None, 'up', wc_dir)
svntest.main.run_svn(None, 'merge', sbox.repo_url + '/A', A_COPY_path,
'-c3')
svntest.main.run_svn(None, 'ci', '-m', 'Merge r3 from A to A_COPY', wc_dir)
svntest.main.run_svn(None, 'up', wc_dir)
svntest.main.run_svn(None, 'merge', sbox.repo_url + '/A', A_COPY_path,
'-c4')
svntest.main.run_svn(None, 'ci', '-m', 'Merge r4 from A to A_COPY', wc_dir)
svntest.main.run_svn(None, 'up', wc_dir)
svntest.main.run_svn(None, 'merge', sbox.repo_url + '/A', A_COPY_path,
'-c5')
svntest.main.file_write(beta_COPY_path, "Branch edit mistake.\n")
svntest.main.run_svn(None, 'ci', '-m', 'Merge r5 from A to A_COPY', wc_dir)
svntest.main.run_svn(None, 'up', wc_dir)
svntest.main.run_svn(None, 'delete', A_COPY_path)
svntest.main.run_svn(None, 'copy', sbox.repo_url + '/A_COPY@8',
A_COPY_path)
svntest.main.run_svn(None, 'ci', '-m', 'Replace A_COPY with A_COPY@8',
wc_dir)
svntest.main.file_write(mu_COPY_path, "Branch edit.\n")
svntest.main.run_svn(None, 'ci', '-m', 'Branch edit',
wc_dir)
svntest.main.run_svn(None, 'up', wc_dir)
svntest.main.run_svn(None, 'merge', sbox.repo_url + '/A', A_COPY_path)
svntest.main.run_svn(None, 'ci', '-m', 'Sycn A_COPY with A', wc_dir)
svntest.main.run_svn(None, 'up', wc_dir)
expected_output = wc.State(A_path, {
'mu' : Item(status='U '),
})
expected_mergeinfo_output = wc.State(A_path, {
'' : Item(status=' U'),
})
expected_elision_output = wc.State(A_path, {
})
expected_status = wc.State(A_path, {
'' : Item(status=' M'),
'B' : Item(status=' '),
'mu' : Item(status='M '),
'B/E' : Item(status=' '),
'B/E/alpha' : Item(status=' '),
'B/E/beta' : Item(status=' '),
'B/lambda' : Item(status=' '),
'B/F' : Item(status=' '),
'C' : Item(status=' '),
'D' : Item(status=' '),
'D/G' : Item(status=' '),
'D/G/pi' : Item(status=' '),
'D/G/rho' : Item(status=' '),
'D/G/tau' : Item(status=' '),
'D/gamma' : Item(status=' '),
'D/H' : Item(status=' '),
'D/H/chi' : Item(status=' '),
'D/H/psi' : Item(status=' '),
'D/H/omega' : Item(status=' '),
})
expected_status.tweak(wc_rev=12)
expected_disk = wc.State('', {
'' : Item(props={SVN_PROP_MERGEINFO : '/A_COPY:2-8,10-12'}),
'B' : Item(),
'mu' : Item("Branch edit.\n"),
'B/E' : Item(),
'B/E/alpha' : Item("This is the file 'alpha'.\n"),
'B/E/beta' : Item("New content"),
'B/lambda' : Item("This is the file 'lambda'.\n"),
'B/F' : Item(),
'C' : Item(),
'D' : Item(),
'D/G' : Item(),
'D/G/pi' : Item("This is the file 'pi'.\n"),
'D/G/rho' : Item("New content"),
'D/G/tau' : Item("This is the file 'tau'.\n"),
'D/gamma' : Item("This is the file 'gamma'.\n"),
'D/H' : Item(),
'D/H/chi' : Item("This is the file 'chi'.\n"),
'D/H/psi' : Item("New content"),
'D/H/omega' : Item("New content"),
})
expected_skip = wc.State(A_path, { })
svntest.actions.run_and_verify_merge(A_path, None, None,
sbox.repo_url + '/A_COPY', None,
expected_output,
expected_mergeinfo_output,
expected_elision_output,
expected_disk,
expected_status,
expected_skip,
[], None, None, None, None, True, True,
'--reintegrate', A_path)
@SkipUnless(svntest.main.is_posix_os)
@Issue(4052)
def reintegrate_symlink_deletion(sbox):
"reintegrate symlink deletion"
sbox.build()
wc_dir = sbox.wc_dir
A_path = sbox.ospath('A')
A_omicron_path = sbox.ospath('A/omicron')
mu_path = sbox.ospath('A/mu')
A_COPY_path = sbox.ospath('A_COPY')
A_COPY_omicron_path = sbox.ospath('A_COPY/omicron')
A_url = sbox.repo_url + "/A"
A_COPY_url = sbox.repo_url + "/A_COPY"
os.symlink(mu_path, A_omicron_path)
sbox.simple_add('A/omicron')
sbox.simple_commit(message='add symlink')
sbox.simple_repo_copy('A', 'A_COPY')
sbox.simple_update()
sbox.simple_rm('A_COPY/omicron')
sbox.simple_commit(message='remove symlink on branch')
svntest.main.run_svn(None, 'merge', '--reintegrate',
A_COPY_url, A_path)
test_list = [ None,
basic_reintegrate,
reintegrate_with_rename,
reintegrate_branch_never_merged_to,
reintegrate_fail_on_modified_wc,
reintegrate_fail_on_mixed_rev_wc,
reintegrate_fail_on_switched_wc,
reintegrate_on_shallow_wc,
reintegrate_fail_on_stale_source,
merge_file_with_space_in_its_path,
reintegrate_with_subtree_mergeinfo,
multiple_reintegrates_from_the_same_branch,
reintegrate_with_self_referential_mergeinfo,
added_subtrees_with_mergeinfo_break_reintegrate,
two_URL_merge_removes_valid_mergeinfo_from_target,
reintegrate_creates_bogus_mergeinfo,
no_source_subtree_mergeinfo,
reintegrate_replaced_source,
reintegrate_symlink_deletion,
]
if __name__ == '__main__':
svntest.main.run_tests(test_list)