Ejemplo n.º 1
0
    def __init__(self, repo=None):
        self.vcs = rabbitvcs.vcs.VCS_GIT
        self.interface = "gittyup"
        if repo:
            self.client = GittyupClient(repo)
        else:
            self.client = GittyupClient()

        self.cache = rabbitvcs.vcs.status.StatusCache()
Ejemplo n.º 2
0
parser.add_option("-c", "--cleanup", action="store_true", default=False)
(options, args) = parser.parse_args(argv)

DIR = "commit"

if options.cleanup:
    rmtree(DIR, ignore_errors=True)

    print("commit.py clean")
else:
    if os.path.isdir(DIR):
        raise SystemExit(
            "This test script has already been run.  Please call this script with --cleanup to start again"
        )

    os.mkdir(DIR)
    g = GittyupClient()
    g.initialize_repository(DIR)

    touch(DIR + "/test1.txt")
    touch(DIR + "/test2.txt")

    g.stage([DIR + "/test1.txt", DIR + "/test2.txt"])
    g.commit("First commit", commit_all=True)

    change(DIR + "/test1.txt")
    g.stage([DIR + "/test1.txt"])
    g.commit("Second commit", author="Alex Plumb <*****@*****.**>")

    print("commit.py pass")
Ejemplo n.º 3
0
parser.add_option("-c", "--cleanup", action="store_true", default=False)
(options, args) = parser.parse_args(argv)

DIR = "config"

if options.cleanup:
    rmtree(DIR, ignore_errors=True)

    print "config.py clean"
else:
    if os.path.isdir(DIR):
        raise SystemExit(
            "This test script has already been run.  Please call this script with --cleanup to start again"
        )

    g = GittyupClient(DIR, create=True)
    c = GittyupLocalFallbackConfig(DIR)

    # Create config items
    c.set("core", "filemode", True)
    c.set("core", "repositoryformatversion", 0)

    # Add comments
    c.set_comment("core", "filemode", ["Regular comment"])
    c.set_inline_comment("core", "repositoryformatversion",
                         "inline repo format comment")

    # Create new section/items and then rename them
    c.set("newsection", "newitem", "Val A")
    c.rename_section("newsection", "newsection_RE")
    c.rename("newsection_RE", "newitem", "newitem_RE")