mirror of
http://git.whoc.org.uk/git/password-manager.git
synced 2024-11-14 18:59:03 +01:00
Merge pull request #43 from jokajak/issue39
Add a fall-back repository class for SNAPSHOTS
This commit is contained in:
commit
0db1d5c8b1
@ -11,12 +11,14 @@ def repositoryWithPath (path):
|
|||||||
except:
|
except:
|
||||||
try:
|
try:
|
||||||
from git import Repo
|
from git import Repo
|
||||||
|
|
||||||
repo = Repo(path)
|
repo = Repo(path)
|
||||||
result = GitRepository(repo, path)
|
result = GitRepository(repo, path)
|
||||||
|
|
||||||
except ImportError, exception:
|
except ImportError, exception:
|
||||||
print "Failed to import git, please install http://gitorious.org/git-python"
|
print "Failed to import git, please install http://gitorious.org/git-python"
|
||||||
raise exception
|
raise exception
|
||||||
|
except:
|
||||||
|
result = SnapshotRepository('', path)
|
||||||
|
|
||||||
|
|
||||||
return result
|
return result
|
||||||
@ -86,3 +88,10 @@ class HgRepository(Repository):
|
|||||||
|
|
||||||
|
|
||||||
#===================================================================
|
#===================================================================
|
||||||
|
|
||||||
|
class SnapshotRepository(Repository):
|
||||||
|
def revision (self):
|
||||||
|
return 'SNAPSHOT'
|
||||||
|
|
||||||
|
def areTherePendingChanges (self):
|
||||||
|
return False
|
||||||
|
Loading…
Reference in New Issue
Block a user