コード例 #1
0
ファイル: commit.py プロジェクト: jmarin/geogitpy
 def __init__(self, repo, commitid, treeid, parent, message, authorname, authordate, commitername, commiterdate):
     Commitish.__init__(self, repo, commitid)        
     self.repo = repo
     self.commitid = commitid
     self.treeid = treeid
     self.parent = parent or NULL_ID
     self.message = message
     self.authorname = authorname
     self.authordate = authordate
     self.commitername = commitername
     self.commiterdate = commiterdate
コード例 #2
0
ファイル: commit.py プロジェクト: roscoeZA/GeoGigSync
 def __init__(self, repo, commitid, treeid, parents, message, authorname, authordate, committername, committerdate):
     Commitish.__init__(self, repo, commitid)        
     self.repo = repo
     self.commitid = commitid
     self.treeid = treeid
     self._parents = parents or [NULL_ID]
     self.message = message
     self.authorname = authorname
     self.authordate = authordate
     self.committername = committername
     self.committerdate = committerdate
コード例 #3
0
 def head(self):
     self.checkisrepo()
     headfile = os.path.join(self.repo.url, '.geogig', 'HEAD')
     with codecs.open(headfile, 'r', 'utf-8') as f:
         line = f.readline()
     ref = line.strip().split()[-1]
     if ref.startswith("refs/heads/"):
         ref = ref[len("refs/heads/"):]
     return Commitish(self.repo, ref)
コード例 #4
0
ファイル: cliconnector.py プロジェクト: roscoeZA/GeoSync
 def commonancestor(self, refa, refb):
     commands = ["merge-base", refa, refb]
     try:
         output = self.run(commands)
         return Commitish(self.repo, output[0].strip())
     except GeoGigException, e:
         if "No common ancestor" in e.args[0]:
             return None
         else:
             raise e
コード例 #5
0
ファイル: commit.py プロジェクト: roscoeZA/GeoGigSync
 def fromref(repo, ref):
     '''
     Returns a Commit corresponding to a given id.
     ref is passed as a string.
     '''
     if ref == NULL_ID:
         return Commitish(repo, NULL_ID)
     else:
         if (repo.url, ref) not in Commit._commitcache:                                
             id = repo.revparse(ref)
             log = repo.log(id, n = 1)
             Commit._commitcache[(repo.url, ref)] = log[0]   
         return Commit._commitcache[(repo.url, ref)]     
コード例 #6
0
 def master(self):
     '''Returns a Commitish representing the master branch'''
     return Commitish(self, geogig.MASTER)
コード例 #7
0
 def workingtree(self):
     '''Returns a Commitish representing workingtree'''
     return Commitish(self, geogig.WORK_HEAD)
コード例 #8
0
 def index(self):
     '''Returns a Commitish representing the index'''
     return Commitish(self, geogig.STAGE_HEAD)