• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

allura


Commit MetaInfo

修訂7f890d6d722682c9b7718e4984f88440f6d80fbc (tree)
時間2012-07-11 07:22:10
作者Tim Van Steenburgh <tvansteenburgh@gmai...>
CommiterCory Johns

Log Message

[#4521] Lookup sha1 for ref from cache instead of disk.

Signed-off-by: Tim Van Steenburgh <tvansteenburgh@gmail.com>

Change Summary

差異

--- a/ForgeGit/forgegit/model/git_repo.py
+++ b/ForgeGit/forgegit/model/git_repo.py
@@ -105,6 +105,10 @@ class GitImplementation(M.RepositoryImplementation):
105105
106106 def commit(self, rev):
107107 '''Return a Commit object. rev can be _id or a branch/tag name'''
108+ for ref in self._repo.heads + self._repo.branches + self._repo.repo_tags:
109+ if ref.name == rev:
110+ rev = ref.object_id
111+ break
108112 result = M.repo.Commit.query.get(_id=rev)
109113 if result is None:
110114 # find the id by branch/tag name
--- a/ForgeHg/forgehg/model/hg.py
+++ b/ForgeHg/forgehg/model/hg.py
@@ -92,6 +92,10 @@ class HgImplementation(M.RepositoryImplementation):
9292 session(self._repo).flush()
9393
9494 def commit(self, rev):
95+ for ref in self._repo.heads + self._repo.branches + self._repo.repo_tags:
96+ if ref.name == rev:
97+ rev = ref.object_id
98+ break
9599 result = M.repo.Commit.query.get(_id=rev)
96100 if result is None:
97101 try: