Example #1
0
 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])
Example #2
0
 def deltag(self, file):
     if (not self.fsonly) and \
            ((not isdarcs()) and (not ishg())):
         if self.verb:
             print "Deleting %s" % file
         if os.path.islink(os.path.join(self.wcpath,file)) or os.path.exists(os.path.join(self.wcpath, file)):
             util.chdircmd(self.wcpath, util.safeexec, vcscmd,
                       cmd().delete + [file])
Example #3
0
 def deltag(self, file):
     if (not self.fsonly) and \
            ((not isdarcs()) and (not ishg())):
         if self.verb:
             print "Deleting %s" % file
         if os.path.islink(os.path.join(
                 self.wcpath, file)) or os.path.exists(
                     os.path.join(self.wcpath, file)):
             util.chdircmd(self.wcpath, util.safeexec, vcscmd,
                           cmd().delete + [file])
Example #4
0
    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])
Example #5
0
 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])
Example #6
0
 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])
Example #7
0
 def addtag(self, file):
     if self.verb:
         print "Adding %s" % file
     if (file[-1] == '/') and \
        (not os.path.exists(os.path.join(self.wcpath,
                                         file[:-1]))):
         try:
             print "addtag: making dir %s" % file[:-1]
             os.makedirs(os.path.join(self.wcpath, file[:-1]))
         except:
             raise
     file = self.slashstrip(file)
     isdir = os.path.isdir(os.path.join(self.wcpath, file))
     if (not self.fsonly) and \
            (not ishg()) and ((not isdarcs()) or isdir):
         # Darcs will see adds later, but we need to add dirs
         # now so darcs mv will work.
         #
         # Mercurial will see adds later, and doesn't track directories,
         # so we don't do anything with it.
         util.chdircmd(self.wcpath, util.safeexec, vcscmd,
                       cmd().add + [file])
Example #8
0
 def addtag(self, file):
     if self.verb:
         print "Adding %s" % file
     if (file[-1] == '/') and \
        (not os.path.exists(os.path.join(self.wcpath,
                                         file[:-1]))):
         try:
             print "addtag: making dir %s" % file[:-1]
             os.makedirs(os.path.join(self.wcpath, file[:-1]))
         except:
             raise
     file = self.slashstrip(file)
     isdir = os.path.isdir(os.path.join(self.wcpath, file))
     if (not self.fsonly) and \
            (not ishg()) and ((not isdarcs()) or isdir):
         # Darcs will see adds later, but we need to add dirs
         # now so darcs mv will work.
         #
         # Mercurial will see adds later, and doesn't track directories,
         # so we don't do anything with it.
         util.chdircmd(self.wcpath, util.safeexec, vcscmd,
                       cmd().add + [file])
Example #9
0
 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()
Example #10
0
 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()