コード例 #1
0
ファイル: vcs_wc.py プロジェクト: praveen97uma/Melange
 def commit(self):
     if self.verb:
         print "Committing changes"
     if isdarcs():
         util.chdircmd(self.wcpath, util.safeexec, vcscmd, [
             cmd().commit, "-l", "-a", "-m", self.summary, "--logfile",
             self.logfn, "--delete-logfile"
         ])
     elif isgit():
         util.chdircmd(self.wcpath, util.safeexec, vcscmd,
                       [cmd().commit, "-a", "-F", self.logfn])
         os.unlink(self.logfn)
     elif ishg():
         util.chdircmd(self.wcpath, util.safeexec, vcscmd,
                       [cmd().commit, "-A", "-l", self.logfn])
         os.unlink(self.logfn)
     else:
         if len(
                 util.chdircmd(self.wcpath, util.getstdoutsafeexec, vcscmd,
                               ['logs'])) == 0:
             util.chdircmd(self.wcpath, util.safeexec, vcscmd,
                           [cmd().importcmd])
         else:
             util.chdircmd(self.wcpath, util.safeexec, vcscmd,
                           [cmd().commit])
コード例 #2
0
ファイル: vcs_wc.py プロジェクト: SRabbelier/Melange
 def doit():
     destdir = os.path.dirname(dest)
     if (not os.path.exists(destdir)) and destdir != '':
         self.makedirs(destdir)
     if self.fsonly or \
        (not isdarcs() and (not isgit()) and (not ishg())):
         # Darcs, hg, and git actually do this when they move the tag
         os.rename(src, dest)
コード例 #3
0
ファイル: vcs_wc.py プロジェクト: praveen97uma/Melange
 def doit():
     destdir = os.path.dirname(dest)
     if (not os.path.exists(destdir)) and destdir != '':
         self.makedirs(destdir)
     if self.fsonly or \
        (not isdarcs() and (not isgit()) and (not ishg())):
         # Darcs, hg, and git actually do this when they move the tag
         os.rename(src, dest)
コード例 #4
0
ファイル: vcs_wc.py プロジェクト: SRabbelier/Melange
 def movetag(self, src, dest):
     if self.verb:
         print "Moving %s to %s" % (src, dest)
     if src[-1] == '/' \
            and dest[-1] == '/' \
            and ((not isdarcs()) and (not isgit()) and (not ishg())):
         # Dir to dir -- darcs mv will catch it already.
         # Git doesn't do rename recording, so don't worry about it?
         return
     src, dest = self.slashstrip(src, dest)
     if not self.fsonly:
         util.chdircmd(self.wcpath, util.safeexec, vcscmd,
                       [cmd().move, src, dest])
コード例 #5
0
ファイル: vcs_wc.py プロジェクト: SRabbelier/Melange
    def makelog(self, summary, logtext):
        self.summary = summary
        self.logtext = logtext
        if ishg() or isgit() or isdarcs():
            logfn = self.wcpath + "/../,,vcslog"
	else:
            logfn =  util.chdircmd(self.wcpath, util.getstdoutsafeexec, vcscmd,
                                   ['make-log'])[0].strip()

        self.logfn = os.path.abspath(logfn)
        
        fd = open(self.logfn, "w")
        if isgit():
            fd.write("%s\n\n" % summary)
        if ishg():
            fd.write("%s\n" % summary)
        elif not (isdarcs() or ishg()):
            fd.write("Summary: %s\n" % summary)
            fd.write("Keywords: \n\n")
        fd.write(logtext)
        print "LOGTEXT", logtext
        fd.close()
コード例 #6
0
ファイル: vcs_wc.py プロジェクト: praveen97uma/Melange
 def movetag(self, src, dest):
     if self.verb:
         print "Moving %s to %s" % (src, dest)
     if src[-1] == '/' \
            and dest[-1] == '/' \
            and ((not isdarcs()) and (not isgit()) and (not ishg())):
         # Dir to dir -- darcs mv will catch it already.
         # Git doesn't do rename recording, so don't worry about it?
         return
     src, dest = self.slashstrip(src, dest)
     if not self.fsonly:
         util.chdircmd(self.wcpath, util.safeexec, vcscmd,
                       [cmd().move, src, dest])
コード例 #7
0
ファイル: vcs_wc.py プロジェクト: praveen97uma/Melange
    def makelog(self, summary, logtext):
        self.summary = summary
        self.logtext = logtext
        if ishg() or isgit() or isdarcs():
            logfn = self.wcpath + "/../,,vcslog"
        else:
            logfn = util.chdircmd(self.wcpath, util.getstdoutsafeexec, vcscmd,
                                  ['make-log'])[0].strip()

        self.logfn = os.path.abspath(logfn)

        fd = open(self.logfn, "w")
        if isgit():
            fd.write("%s\n\n" % summary)
        if ishg():
            fd.write("%s\n" % summary)
        elif not (isdarcs() or ishg()):
            fd.write("Summary: %s\n" % summary)
            fd.write("Keywords: \n\n")
        fd.write(logtext)
        print "LOGTEXT", logtext
        fd.close()
コード例 #8
0
ファイル: vcs_wc.py プロジェクト: SRabbelier/Melange
 def gettreeversion(self):
     if isdarcs():
         #util.chdircmd(self.wcpath, util.getstdoutsafeexec, "darcs",
         #              ['check'])
         return "Darcs repository"
     elif ishg():
         return "Mercurial repository"
     elif issvk():
         return "Svk repository"
     elif isgit():
         return "Git repository"
     else:
         return util.chdircmd(self.wcpath, util.getstdoutsafeexec, vcscmd,
                              ['tree-version'])[0].strip() 
コード例 #9
0
ファイル: vcs_wc.py プロジェクト: praveen97uma/Melange
 def gettreeversion(self):
     if isdarcs():
         #util.chdircmd(self.wcpath, util.getstdoutsafeexec, "darcs",
         #              ['check'])
         return "Darcs repository"
     elif ishg():
         return "Mercurial repository"
     elif issvk():
         return "Svk repository"
     elif isgit():
         return "Git repository"
     else:
         return util.chdircmd(self.wcpath, util.getstdoutsafeexec, vcscmd,
                              ['tree-version'])[0].strip()
コード例 #10
0
ファイル: vcs_wc.py プロジェクト: SRabbelier/Melange
    def commit(self):
        if self.verb:
            print "Committing changes"
        if isdarcs():
            util.chdircmd(self.wcpath, util.safeexec, vcscmd,
                          [cmd().commit, "-l", "-a", "-m", self.summary,
                           "--logfile", self.logfn,
                           "--delete-logfile"])
        elif isgit():
            util.chdircmd(self.wcpath, util.safeexec, vcscmd,
                          [cmd().commit, "-a", "-F", self.logfn])
	    os.unlink(self.logfn)
        elif ishg():
            util.chdircmd(self.wcpath, util.safeexec, vcscmd,
                          [cmd().commit, "-A", "-l", self.logfn])
            os.unlink(self.logfn)
        else:
            if len(util.chdircmd(self.wcpath, util.getstdoutsafeexec, vcscmd, ['logs']))==0:
                util.chdircmd(self.wcpath, util.safeexec, vcscmd, [cmd().importcmd])
            else:
                util.chdircmd(self.wcpath, util.safeexec, vcscmd, [cmd().commit])
コード例 #11
0
ファイル: vcs_wc.py プロジェクト: SRabbelier/Melange
 def gettaggingmethod(self):
     if isdarcs() or isgit() or ishg():
         return 'explicit'
     else:
         return util.chdircmd(self.wcpath, util.getstdoutsafeexec, vcscmd,
                              [cmd().tagging_method])[0].strip()
コード例 #12
0
ファイル: vcs_wc.py プロジェクト: praveen97uma/Melange
 def gettaggingmethod(self):
     if isdarcs() or isgit() or ishg():
         return 'explicit'
     else:
         return util.chdircmd(self.wcpath, util.getstdoutsafeexec, vcscmd,
                              [cmd().tagging_method])[0].strip()