示例#1
0
 def decorated(self, **kwargs):
     if os.getcwd() != self.local:
         if DirCommands.isLocalDirectExist(self.local):
             DirCommands.enterDirAbs(self.local)
         else:
             raise GitError(self.local, "Local path not exist")
     return f(self, **kwargs)
示例#2
0
 def pushLocalBranch(self):
     (status, output) = commands.getstatusoutput(
         "git push origin caencompile_submit:caencompile_submit")
     if status != 0:
         self.checkLocalMaster()
         self.deleteLocalBranch()
         raise GitError(os.getcwd, output)
示例#3
0
 def pullRemoteBranch(self):
     with cd(self.remote):
         ret = run("git pull origin caencompile_submit")
         if not ret.succeeded:
             self.checkLocalMaster()
             self.createLocalBranch()
             self.deleteRemoteBranch()
             raise GitError(self.remote, ret)
示例#4
0
 def checkCaenBranch(self):
     with cd(self.remote):
         ret = run("git checkout origin/HEAD")
         if not ret.succeeded:
             self.checkRemoteMaster()
             self.checkLocalMaster()
             self.createLocalBranch()
             self.deleteRemoteBranch()
             raise GitError(self.remote, ret)
示例#5
0
 def testRemote(self):
     with cd(self.remote):
         ret = run("ls")
         if not ret.succeeded:
             raise GitError(self.remote, ret)
示例#6
0
 def deleteRemoteBranch(self):
     self.checkLocalMaster()
     (status, output
      ) = commands.getstatusoutput("git push origin :caencompile_submit ")
     if status != 0:
         raise GitError(os.getcwd, output)
示例#7
0
 def deleteLocalBranch(self):
     self.checkLocalMaster()
     (status,
      output) = commands.getstatusoutput("git branch -D caencompile_submit")
     if status != 0:
         raise GitError(os.getcwd, output)
示例#8
0
 def createLocalBranch(self):
     (status, output
      ) = commands.getstatusoutput("git checkout -b caencompile_submit")
     if status != 0:
         raise GitError(os.getcwd(), output)
示例#9
0
 def checkLocalMaster(self):
     (status, output) = commands.getstatusoutput("git checkout master")
     if status != 0:
         raise GitError(os.getcwd(), output)
示例#10
0
 def testLocal(self):
     (status, output) = commands.getstatusoutput("mkdir tmp")
     if status != 0:
         raise GitError(os.getcwd(), output)
示例#11
0
 def decorated(self, **kwargs):
     if not DirCommands.isRemoteDirectExist(self.remote):
         raise GitError(self.remote, "Remote path not exist")
     return f(self, **kwargs)
示例#12
0
 def checkRemoteMaster(self):
     with cd(self.remote):
         ret = run("git checkout master")
         if not ret.succeeded:
             raise GitError(self.remote, ret)
示例#13
0
 def cloneGit(self, gitAddr):
     if DirCommands.isRemoteDirectExist(InitCommands.remote):
         with cd(InitCommands.remote):
             ret = run("git clone %s git" % gitAddr)
             if not ret.succeeded:
                 raise GitError(InitCommands.remote, ret)