Esempio n. 1
0
def forced_checkout_of_file_with_dir_obstructions(sbox):
    """forced co flags conflict if a dir obstructs a file"""
    # svntest.factory.make(sbox,
    #                      """mkdir $WC_DIR.other/iota
    #                         svn co --force url $WC_DIR.other """)
    sbox.build()
    url = sbox.repo_url
    wc_dir_other = sbox.add_wc_path("other")

    other_iota = os.path.join(wc_dir_other, "iota")

    # mkdir $WC_DIR.other/iota
    os.makedirs(other_iota)

    # svn co --force url $WC_DIR.other
    expected_output = svntest.wc.State(
        wc_dir_other,
        {
            "A": Item(status="A "),
            "A/B": Item(status="A "),
            "A/B/E": Item(status="A "),
            "A/B/E/alpha": Item(status="A "),
            "A/B/E/beta": Item(status="A "),
            "A/B/F": Item(status="A "),
            "A/B/lambda": Item(status="A "),
            "A/D": Item(status="A "),
            "A/D/H": Item(status="A "),
            "A/D/H/chi": Item(status="A "),
            "A/D/H/omega": Item(status="A "),
            "A/D/H/psi": Item(status="A "),
            "A/D/G": Item(status="A "),
            "A/D/G/pi": Item(status="A "),
            "A/D/G/rho": Item(status="A "),
            "A/D/G/tau": Item(status="A "),
            "A/D/gamma": Item(status="A "),
            "A/C": Item(status="A "),
            "A/mu": Item(status="A "),
            "iota": Item(status="  ", treeconflict="C"),
        },
    )

    expected_disk = svntest.main.greek_state.copy()
    expected_disk.tweak("iota", contents=None)

    actions.run_and_verify_checkout(url, wc_dir_other, expected_output, expected_disk, [], "--force")
Esempio n. 2
0
def forced_checkout_of_file_with_dir_obstructions(sbox):
    """forced co flags conflict if a dir obstructs a file"""
    # svntest.factory.make(sbox,
    #                      """mkdir $WC_DIR.other/iota
    #                         svn co --force url $WC_DIR.other """)
    sbox.build()
    url = sbox.repo_url
    wc_dir_other = sbox.add_wc_path('other')

    other_iota = os.path.join(wc_dir_other, 'iota')

    # mkdir $WC_DIR.other/iota
    os.makedirs(other_iota)

    # svn co --force url $WC_DIR.other
    expected_output = svntest.wc.State(
        wc_dir_other, {
            'A': Item(status='A '),
            'A/B': Item(status='A '),
            'A/B/E': Item(status='A '),
            'A/B/E/alpha': Item(status='A '),
            'A/B/E/beta': Item(status='A '),
            'A/B/F': Item(status='A '),
            'A/B/lambda': Item(status='A '),
            'A/D': Item(status='A '),
            'A/D/H': Item(status='A '),
            'A/D/H/chi': Item(status='A '),
            'A/D/H/omega': Item(status='A '),
            'A/D/H/psi': Item(status='A '),
            'A/D/G': Item(status='A '),
            'A/D/G/pi': Item(status='A '),
            'A/D/G/rho': Item(status='A '),
            'A/D/G/tau': Item(status='A '),
            'A/D/gamma': Item(status='A '),
            'A/C': Item(status='A '),
            'A/mu': Item(status='A '),
            'iota': Item(status='  ', treeconflict='C'),
        })

    expected_disk = svntest.main.greek_state.copy()
    expected_disk.tweak('iota', contents=None)

    actions.run_and_verify_checkout(url, wc_dir_other, expected_output,
                                    expected_disk, None, None, None, None,
                                    '--force')
Esempio n. 3
0
def forced_checkout_of_file_with_dir_obstructions(sbox):
  """forced co flags conflict if a dir obstructs a file"""
  # svntest.factory.make(sbox,
  #                      """mkdir $WC_DIR.other/iota
  #                         svn co --force url $WC_DIR.other """)
  sbox.build()
  url = sbox.repo_url
  wc_dir_other = sbox.add_wc_path('other')

  other_iota = os.path.join(wc_dir_other, 'iota')

  # mkdir $WC_DIR.other/iota
  os.makedirs(other_iota)

  # svn co --force url $WC_DIR.other
  expected_output = svntest.wc.State(wc_dir_other, {
    'A'                 : Item(status='A '),
    'A/B'               : Item(status='A '),
    'A/B/E'             : Item(status='A '),
    'A/B/E/alpha'       : Item(status='A '),
    'A/B/E/beta'        : Item(status='A '),
    'A/B/F'             : Item(status='A '),
    'A/B/lambda'        : Item(status='A '),
    'A/D'               : Item(status='A '),
    'A/D/H'             : Item(status='A '),
    'A/D/H/chi'         : Item(status='A '),
    'A/D/H/omega'       : Item(status='A '),
    'A/D/H/psi'         : Item(status='A '),
    'A/D/G'             : Item(status='A '),
    'A/D/G/pi'          : Item(status='A '),
    'A/D/G/rho'         : Item(status='A '),
    'A/D/G/tau'         : Item(status='A '),
    'A/D/gamma'         : Item(status='A '),
    'A/C'               : Item(status='A '),
    'A/mu'              : Item(status='A '),
    'iota'              : Item(status='  ', treeconflict='C'),
  })

  expected_disk = svntest.main.greek_state.copy()
  expected_disk.tweak('iota', contents=None)

  actions.run_and_verify_checkout(url, wc_dir_other, expected_output,
    expected_disk, [], '--force')
Esempio n. 4
0
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)
Esempio n. 5
0
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)
Esempio n. 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,)
Esempio n. 7
0
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)
Esempio n. 8
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)