Пример #1
0
def test_files_with_space(svn_server, tmpdir):
    foo_url = svn_server.create_repo("foo")
    svn_server.commit_file("foo", "file with space.txt", "some contents\n")
    work = tmpdir.mkdir("work")
    foo = work.mkdir("foo")
    svn = qisrc.svn.Svn(foo.strpath)
    svn.call("checkout", foo_url, ".")
    foo.join("file with space.txt").remove()
    svn.commit_all("test message")
Пример #2
0
def test_files_with_space(svn_server, tmpdir):
    foo_url = svn_server.create_repo("foo")
    svn_server.commit_file("foo", "file with space.txt", "some contents\n")
    work = tmpdir.mkdir("work")
    foo = work.mkdir("foo")
    svn = qisrc.svn.Svn(foo.strpath)
    svn.call("checkout", foo_url, ".")
    foo.join("file with space.txt").remove()
    svn.commit_all("test message")
Пример #3
0
def test_file_replaced_by_symlink(svn_server, tmpdir):
    foo_url = svn_server.create_repo("foo")
    svn_server.commit_file("foo", "a.txt", "this is a\n")
    work = tmpdir.mkdir("work")
    foo = work.mkdir("foo")
    svn = qisrc.svn.Svn(foo.strpath)
    svn.call("checkout", foo_url, ".")
    foo.join("a.txt").remove()
    foo.ensure("b.txt", file=True)
    foo.join("a.txt").mksymlinkto("b.txt")
    svn.commit_all("test message")
Пример #4
0
def test_file_replaced_by_symlink(svn_server, tmpdir):
    foo_url = svn_server.create_repo("foo")
    svn_server.commit_file("foo", "a.txt", "this is a\n")
    work = tmpdir.mkdir("work")
    foo = work.mkdir("foo")
    svn = qisrc.svn.Svn(foo.strpath)
    svn.call("checkout", foo_url, ".")
    foo.join("a.txt").remove()
    foo.ensure("b.txt", file=True)
    foo.join("a.txt").mksymlinkto("b.txt")
    svn.commit_all("test message")
Пример #5
0
def test_commit_all_removes_removed_files(svn_server, tmpdir):
    foo_url = svn_server.create_repo("foo")
    svn_server.commit_file("foo", "bar.txt", "this is bar")
    work = tmpdir.mkdir("work")
    foo = work.mkdir("foo")
    svn = qisrc.svn.Svn(foo.strpath)
    svn.call("checkout", foo_url, ".")
    foo.join("bar.txt").remove()
    svn.commit_all("test message")
    work2 = tmpdir.mkdir("work2")
    foo2 = work2.mkdir("foo2")
    svn = qisrc.svn.Svn(foo2.strpath)
    svn.call("checkout", foo_url, ".")
    assert not foo2.join("bar.txt").check(file=True)
Пример #6
0
def test_commit_all_removes_removed_files(svn_server, tmpdir):
    foo_url = svn_server.create_repo("foo")
    svn_server.commit_file("foo", "bar.txt", "this is bar")
    work = tmpdir.mkdir("work")
    foo = work.mkdir("foo")
    svn = qisrc.svn.Svn(foo.strpath)
    svn.call("checkout", foo_url, ".")
    foo.join("bar.txt").remove()
    svn.commit_all("test message")
    work2 = tmpdir.mkdir("work2")
    foo2 = work2.mkdir("foo2")
    svn = qisrc.svn.Svn(foo2.strpath)
    svn.call("checkout", foo_url, ".")
    assert not foo2.join("bar.txt").check(file=True)
Пример #7
0
def test_commit_all_adds_new_subfolders(svn_server, tmpdir):
    foo_url = svn_server.create_repo("foo")
    work = tmpdir.mkdir("work")
    foo = work.mkdir("foo")
    svn = qisrc.svn.Svn(foo.strpath)
    svn.call("checkout", foo_url, ".")
    foo.ensure("some/sub/folder", dir=True)
    foo.ensure("some/sub/folder/bar.txt")
    svn.commit_all("test message")
    work2 = tmpdir.mkdir("work2")
    foo2 = work2.mkdir("foo2")
    svn = qisrc.svn.Svn(foo2.strpath)
    svn.call("checkout", foo_url, ".")
    assert foo2.join("some", "sub", "folder").check(dir=True)
    assert foo2.join("some", "sub", "folder", "bar.txt").check(file=True)
Пример #8
0
def test_commit_all_adds_new_subfolders(svn_server, tmpdir):
    foo_url = svn_server.create_repo("foo")
    work = tmpdir.mkdir("work")
    foo = work.mkdir("foo")
    svn = qisrc.svn.Svn(foo.strpath)
    svn.call("checkout", foo_url, ".")
    foo.ensure("some/sub/folder", dir=True)
    foo.ensure("some/sub/folder/bar.txt")
    svn.commit_all("test message")
    work2 = tmpdir.mkdir("work2")
    foo2 = work2.mkdir("foo2")
    svn = qisrc.svn.Svn(foo2.strpath)
    svn.call("checkout", foo_url, ".")
    assert foo2.join("some", "sub", "folder").check(dir=True)
    assert foo2.join("some", "sub", "folder", "bar.txt").check(file=True)
Пример #9
0
def do(args):
    """ Main entry point """
    toolchain = qitoolchain.get_toolchain(args.name)
    svn_packages = list()
    for package in toolchain.packages:
        svn_dir = os.path.join(package.path, ".svn")
        if os.path.exists(svn_dir):
            svn_packages.append(package)
    not_clean = list()
    for i, svn_package in enumerate(svn_packages, start=1):
        to_write = "Checking (%d/%d) " % (i, len(svn_packages))
        sys.stdout.write(to_write + "\r")
        sys.stdout.flush()
        svn = qisrc.svn.Svn(svn_package.path)
        rc, out = svn.call("status", raises=False)
        if out:
            not_clean.append((svn_package.name, out))
    if not not_clean:
        ui.info("\n", ui.green, "All OK")
        sys.exit(0)
    ui.warning("Some svn packages are not clean")
    for name, message in not_clean:
        ui.info(ui.green, "*", ui.reset, ui.blue, name)
        ui.info(message)
    sys.exit(1)
Пример #10
0
def do(args):
    """ Main entry point """
    toolchain = qitoolchain.get_toolchain(args.name)
    svn_packages = list()
    for package in toolchain.packages:
        svn_dir = os.path.join(package.path, ".svn")
        if os.path.exists(svn_dir):
            svn_packages.append(package)
    not_clean = list()
    for i, svn_package in enumerate(svn_packages, start=1):
        to_write = "Checking (%d/%d) " % (i, len(svn_packages))
        sys.stdout.write(to_write + "\r")
        sys.stdout.flush()
        svn = qisrc.svn.Svn(svn_package.path)
        _rc, out = svn.call("status", raises=False)
        if out:
            not_clean.append((svn_package.name, out))
    if not not_clean:
        ui.info("\n", ui.green, "All OK")
        sys.exit(0)
    ui.warning("Some svn packages are not clean")
    for name, message in not_clean:
        ui.info(ui.green, "*", ui.reset, ui.blue, name)
        ui.info(message)
    sys.exit(1)