Changeset 3212

Show
Ignore:
Timestamp:
02/11/08 05:23:41 (9 months ago)
Author:
hvr
Message:

GitPlugin: cleanups, factorizations, and minor fixes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • gitplugin/0.11/tracext/git/git_fs.py

    r3211 r3212  
    1515from trac.core import * 
    1616from trac.util import TracError, shorten_line 
    17 from trac.util.datefmt import utc, FixedOffset 
     17from trac.util.datefmt import FixedOffset, to_timestamp 
    1818from trac.versioncontrol.api import \ 
    1919    Changeset, Node, Repository, IRepositoryConnector, NoSuchChangeset, NoSuchNode 
     
    203203        def get_changesets(self, start, stop): 
    204204                #print "get_changesets", start, stop 
    205                 def to_unix(dt): 
    206                         return time.mktime(dt.timetuple()) + dt.microsecond/1e6 
    207  
    208                 for rev in self.git.history_timerange(to_unix(start), to_unix(stop)): 
     205                for rev in self.git.history_timerange(to_timestamp(start), to_timestamp(stop)): 
    209206                        yield self.get_changeset(rev) 
    210207 
     
    259256                if rev_callback: 
    260257                        revs = set(self.git.all_revs()) - revs 
    261                         for r in revs: 
    262                                 rev_callback(r
     258                        for rev in revs: 
     259                                rev_callback(rev
    263260 
    264261class GitNode(Node): 
     
    328325                        return 
    329326 
    330                 for e in self.git.ls_tree(self.rev, self.__git_path()): 
    331                         yield GitNode(self.git, e[3], self.rev, self.log, e
     327                for ent in self.git.ls_tree(self.rev, self.__git_path()): 
     328                        yield GitNode(self.git, ent[3], self.rev, self.log, ent
    332329 
    333330        def get_content_type(self): 
  • gitplugin/0.11/tracext/git/PyGIT.py

    r3211 r3212  
    265265 
    266266    def get_branches(self): 
    267         "returns list of branches, with active (= HEAD) one being the first item" 
     267        "returns list of (local) branches, with active (= HEAD) one being the first item" 
    268268        result=[] 
    269269        for e in self._git_call_f("branch", ["-v", "--no-abbrev"]).readlines(): 
     
    276276 
    277277    def get_tags(self): 
    278         result=[] 
    279         for e in self._git_call_f("tag", ["-l"]).readlines(): 
    280             result.append(e.strip()) 
    281         return result 
     278        return [e.strip() for e in self._git_call_f("tag", ["-l"]).readlines()] 
    282279 
    283280    def ls_tree(self, rev, path=""):