Example #1
0
def fail_add_mixed_eol_style(sbox):
    "fail to add a file with mixed EOL style"

    from svntest.actions import run_and_verify_svn, run_and_verify_unquiet_status

    # Bootstrap
    sbox.build()

    filename = "mixed-eol.txt"
    filepath = os.path.join(sbox.wc_dir, filename)
    parameters = ["--auto-props", "--config-option=config:auto-props:" + filename + "=svn:eol-style=native"]

    svntest.main.file_write(filepath, "foo\nbar\r\nbaz\r")

    expected_stderr = (
        "svn: E200009: File '.*"
        + filename
        + "' has inconsistent newlines"
        + "|"
        + "svn: E135000: Inconsistent line ending style\n"
    )
    run_and_verify_svn(None, [], expected_stderr, "add", filepath, *parameters)

    expected_status = svntest.wc.State(sbox.wc_dir, {filename: Item(status="? ")})
    run_and_verify_unquiet_status(filepath, expected_status)
Example #2
0
def fail_add_mixed_eol_style(sbox):
    "fail to add a file with mixed EOL style"

    from svntest.actions import run_and_verify_svn, run_and_verify_unquiet_status

    # Bootstrap
    sbox.build()

    filename = 'mixed-eol.txt'
    filepath = os.path.join(sbox.wc_dir, filename)
    parameters = [
        '--auto-props', '--config-option=config:auto-props:' + filename +
        '=svn:eol-style=native'
    ]

    svntest.main.file_write(filepath, 'foo\nbar\r\nbaz\r')

    expected_stderr = "svn: E200009: File '.*" + filename + \
                      "' has inconsistent newlines" + \
                      "|" + "svn: E135000: Inconsistent line ending style\n"
    run_and_verify_svn(None, [], expected_stderr, 'add', filepath, *parameters)

    expected_status = svntest.wc.State(sbox.wc_dir,
                                       {filename: Item(status='? ')})
    run_and_verify_unquiet_status(filepath, expected_status)
Example #3
0
def fail_add_mixed_eol_style(sbox):
  "fail to add a file with mixed EOL style"

  from svntest.actions import run_and_verify_svn, run_and_verify_unquiet_status

  # Bootstrap
  sbox.build()

  filename = 'mixed-eol.txt'
  filepath = os.path.join(sbox.wc_dir, filename)
  parameters = ['--auto-props',
                '--config-option=config:auto-props:' + filename
                + '=svn:eol-style=native']

  svntest.main.file_write(filepath, 'foo\nbar\r\nbaz\r')

  expected_stderr = "svn: E200009: File '.*" + filename + \
                    "' has inconsistent newlines" + \
                    "|" + "svn: E135000: Inconsistent line ending style\n"
  run_and_verify_svn([], expected_stderr,
                     'add', filepath, *parameters)

  expected_status = svntest.wc.State(sbox.wc_dir,
    {filename : Item(status='? ')})
  run_and_verify_unquiet_status(filepath, expected_status)
Example #4
0
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)
Example #5
0
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,)
Example #6
0
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)