Exemple #1
0
 def setUpConflictingSubmoduleMerge(self):
     os.chdir(self.defaultWorkingDirectory)
     self.createTestSubmodule()
     git.branch("testSubmoduleMerge2")
     subPath = os.path.join(self.repo, "submodule1")
     os.chdir(subPath)
     git.branch("testSubmoduleMerge2")
     git.checkout("master")
     testGrape.writeFile2("f1")
     git.add("f1")
     git.commit("-m \"added f2 as f1\"")
     os.chdir(self.repo)
     git.commit(
         "submodule1 -m \"updated submodule gitlink on master branch\"")
     git.checkout("testSubmoduleMerge2")
     git.submodule("update")
     os.chdir(subPath)
     git.checkout("testSubmoduleMerge2")
     testGrape.writeFile3("f1")
     git.add("f1")
     git.commit("-m \"added f3 as f1\"")
     os.chdir(self.repo)
     git.commit(
         "submodule1 -m \"updated submodule gitlink on testSubmoduleMerge branch\""
     )
     self.setUpConfig()
Exemple #2
0
    def setUpSubmoduleBranch(self):
        git.clone("%s %s" % (self.repo, self.repos[1]))
        os.chdir(self.repo)
        git.checkout("-b addSubmodule")
        git.submodule("add %s submodule" % self.repos[1])
        git.commit("-m \"added submodule\"")
        git.push("origin HEAD")

        # put the remote for the submodule into a HEAD-less state so it can accept pushes
        os.chdir(self.repos[1])
        git.checkout("--orphan HEAD")

        # go to the submodule and add a file to it.
        os.chdir(os.path.join(self.repo,"submodule"))
        f2 = os.path.join(self.repo,"submodule","f2")
        testGrape.writeFile2(f2)
        git.checkout("-b addSubmodule")
        git.add(f2)
        git.commit("-m \"added f2\"")

        # add another file on the master branch for the submodule
        git.branch("-f master HEAD")
        git.checkout("master")
        f3 = os.path.join(self.repo, "submodule", "f3")
        testGrape.writeFile3(f3)
        git.add(f3)
        git.commit("f3 -m \"f3\"")

        # update the submodule's remote
        git.push("origin --all")

        # git back to the master branch in the original repository
        os.chdir(self.repo)
        git.checkout("master")
Exemple #3
0
    def setUpNonConflictingSubmoduleMerge(self):
        os.chdir(self.defaultWorkingDirectory)
        self.createTestSubmodule()
        git.branch("testSubmoduleMerge")
        # create a new commit in submodule1
        os.chdir(os.path.join(self.repo, "submodule1"))
        git.checkout("master")
        testGrape.writeFile2("f1")
        git.add("f1")
        git.commit("-m \"added f2 as f1\"")
        # update outer level with new commit
        os.chdir(self.repo)
        git.commit(
            "submodule1 -m \"updated submodule gitlink on master branch\"")

        # setup what should be a notionally-conflict free merge
        # (grape needs to deal with the gitlink conflicts automatically)
        git.checkout("testSubmoduleMerge")
        git.submodule("update")
        os.chdir(os.path.join(self.repo, "submodule1"))
        git.checkout("-b testSubmoduleMerge")
        testGrape.writeFile3("f2")
        git.add("f2")
        git.commit("-m \"added f3 as f2\"")
        os.chdir(self.repo)
        git.commit("-a -m \"updated gitlink on branch testSubmoduleMerge\"")
        self.setUpConfig()
Exemple #4
0
    def setUpSubmoduleBranch(self):
        git.clone("%s %s" % (self.repo, self.repos[1]))
        os.chdir(self.repo)
        git.checkout("-b addSubmodule")
        git.submodule("add %s submodule" % self.repos[1])
        git.commit("-m \"added submodule\"")
        git.push("origin HEAD")

        # put the remote for the submodule into a HEAD-less state so it can accept pushes
        os.chdir(self.repos[1])
        git.checkout("--orphan HEAD")

        # go to the submodule and add a file to it.
        os.chdir(os.path.join(self.repo, "submodule"))
        f2 = os.path.join(self.repo, "submodule", "f2")
        testGrape.writeFile2(f2)
        git.checkout("-b addSubmodule")
        git.add(f2)
        git.commit("-m \"added f2\"")

        # add another file on the master branch for the submodule
        git.branch("-f master HEAD")
        git.checkout("master")
        f3 = os.path.join(self.repo, "submodule", "f3")
        testGrape.writeFile3(f3)
        git.add(f3)
        git.commit("f3 -m \"f3\"")

        # update the submodule's remote
        git.push("origin --all")

        # git back to the master branch in the original repository
        os.chdir(self.repo)
        git.checkout("master")
Exemple #5
0
    def setUpNonConflictingSubmoduleMerge(self):
        os.chdir(self.defaultWorkingDirectory)
        self.createTestSubmodule()
        git.branch("testSubmoduleMerge")
        # create a new commit in submodule1
        os.chdir(os.path.join(self.repo, "submodule1"))
        git.checkout("master")
        testGrape.writeFile2("f1")
        git.add("f1")
        git.commit("-m \"added f2 as f1\"")
        # update outer level with new commit
        os.chdir(self.repo)
        git.commit("submodule1 -m \"updated submodule gitlink on master branch\"")

        # setup what should be a notionally-conflict free merge
        # (grape needs to deal with the gitlink conflicts automatically)
        git.checkout("testSubmoduleMerge")
        git.submodule("update")
        os.chdir(os.path.join(self.repo, "submodule1"))
        git.checkout("-b testSubmoduleMerge")
        testGrape.writeFile3("f2")
        git.add("f2")
        git.commit("-m \"added f3 as f2\"")
        os.chdir(self.repo)
        git.commit("-a -m \"updated gitlink on branch testSubmoduleMerge\"")
        self.setUpConfig()
Exemple #6
0
 def setUpBranchToFFMerge(self):
     os.chdir(self.repo)
     self.branch = "testPublish"
     git.checkout("-b %s" % self.branch)
     testGrape.writeFile2("f2")
     git.add("f2")
     git.commit("-m \"added f2\"")
     self.setUpConfig()
Exemple #7
0
 def setUpBranchToFFMerge(self):
     os.chdir(self.repo)
     self.branch = "testPublish"
     git.checkout("-b %s" % self.branch)
     testGrape.writeFile2("f2")
     git.add("f2")
     git.commit("-m \"added f2\"")
     self.setUpConfig()
Exemple #8
0
 def setUpMerge(self):
     os.chdir(self.repo)
     # create a new branch
     git.branch("testMerge")
     # add f2 to master
     testGrape.writeFile2("f2")
     git.add("f2")
     git.commit("-m \"f2\"")
     git.checkout("testMerge")
     self.setUpConfig()
Exemple #9
0
 def setUpMerge(self):
     os.chdir(self.repo)
     # create a new branch
     git.branch("testMerge")
     # add f2 to master
     testGrape.writeFile2("f2")
     git.add("f2")
     git.commit("-m \"f2\"")
     git.checkout("testMerge")
     self.setUpConfig()
Exemple #10
0
 def setUpConflictingNestedSubprojectMerge(self):
     os.chdir(self.defaultWorkingDirectory)
     testNestedSubproject.TestNestedSubproject.assertCanAddNewSubproject(self)
     os.chdir(self.subproject)
     
     # set up f1 with conflicting content on master  and testNestedMerge branches. 
     git.checkout("master")
     git.branch("testNestedMerge")
     testGrape.writeFile2("f1")
     git.add("f1")
     git.commit("-m \"added f2 as f1\"")
     git.checkout("testNestedMerge")
     testGrape.writeFile3("f1")
     git.add("f1")
     git.commit("-m \"added f1 as f1\"")
     
     os.chdir(self.repo)
Exemple #11
0
    def setUpConflictingNestedSubprojectMerge(self):
        os.chdir(self.defaultWorkingDirectory)
        testNestedSubproject.TestNestedSubproject.assertCanAddNewSubproject(
            self)
        os.chdir(self.subproject)

        # set up f1 with conflicting content on master  and testNestedMerge branches.
        git.checkout("master")
        git.branch("testNestedMerge")
        testGrape.writeFile2("f1")
        git.add("f1")
        git.commit("-m \"added f2 as f1\"")
        git.checkout("testNestedMerge")
        testGrape.writeFile3("f1")
        git.add("f1")
        git.commit("-m \"added f1 as f1\"")

        os.chdir(self.repo)
Exemple #12
0
 def setUpConflictingSubmoduleMerge(self):
     os.chdir(self.defaultWorkingDirectory)
     self.createTestSubmodule()
     git.branch("testSubmoduleMerge2")
     subPath = os.path.join(self.repo, "submodule1")
     os.chdir(subPath)
     git.branch("testSubmoduleMerge2")
     git.checkout("master")
     testGrape.writeFile2("f1")
     git.add("f1")
     git.commit("-m \"added f2 as f1\"")
     os.chdir(self.repo)
     git.commit("submodule1 -m \"updated submodule gitlink on master branch\"")
     git.checkout("testSubmoduleMerge2")
     git.submodule("update")
     os.chdir(subPath)
     git.checkout("testSubmoduleMerge2")
     testGrape.writeFile3("f1")
     git.add("f1")
     git.commit("-m \"added f3 as f1\"")
     os.chdir(self.repo)
     git.commit("submodule1 -m \"updated submodule gitlink on testSubmoduleMerge branch\"")
     self.setUpConfig()