Changeset 3187

Show
Ignore:
Timestamp:
02/06/08 09:49:01 (10 months ago)
Author:
hvr
Message:

implemented `get_quickjump_targets' method; addresses #789

Files:

Legend:

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

    r3185 r3187  
    152152                return GitNode(self.git, path, rev) 
    153153 
     154        def get_quickjump_entries(self, rev): 
     155                for bname,bsha in self.git.get_branches(): 
     156                        yield 'branches', bname, '/', bsha 
     157                for t in self.git.get_tags(): 
     158                        yield 'tags', t, '/', t 
     159 
    154160        def get_changesets(self, start, stop): 
    155161                #print "get_changesets", start, stop 
  • gitplugin/0.11/gitplugin/PyGIT.py

    r3185 r3187  
    234234 
    235235    def get_branches(self): 
    236         "returns list of branches, with active (i.e. HEAD) one being the first item" 
     236        "returns list of branches, with active (= HEAD) one being the first item" 
    237237        result=[] 
    238         for e in self._git_call_f("git-branch").readlines(): 
    239             bname=e[1:].strip() 
     238        for e in self._git_call_f("git-branch -v --no-abbrev").readlines(): 
     239            (bname,bsha)=e[1:].strip().split()[:2] 
    240240            if e[0]=='*': 
    241                 result.insert(0,bname
     241                result.insert(0,(bname,bsha)
    242242            else: 
    243                 result.append(bname) 
     243                result.append((bname,bsha)) 
     244        return result 
     245 
     246    def get_tags(self): 
     247        result=[] 
     248        for e in self._git_call_f("git-tag -l").readlines(): 
     249            result.append(e.strip()) 
    244250        return result 
    245251 
     
    357363 
    358364if __name__ == '__main__': 
    359     import sys 
    360  
    361     g = Storage(sys.argv[1]
     365    import sys, logging 
     366 
     367    g = Storage(sys.argv[1], logging
    362368 
    363369    print "[%s]" % g.head()