mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-16 07:52:35 +03:00
New Update Check Mode: RepoTrunk
This commit is contained in:
parent
efcf850247
commit
b75d8b7271
3 changed files with 54 additions and 0 deletions
|
@ -126,6 +126,10 @@ class vcs:
|
|||
def gettags(self):
|
||||
raise VCSException('gettags not supported for this vcs type')
|
||||
|
||||
# Get current commit reference (hash, revision, etc)
|
||||
def getref(self):
|
||||
raise VCSException('getref not supported for this vcs type')
|
||||
|
||||
# Returns the srclib (name, path) used in setting up the current
|
||||
# revision, or None.
|
||||
def getsrclib(self):
|
||||
|
@ -287,6 +291,12 @@ class vcs_gitsvn(vcs):
|
|||
self.checkrepo()
|
||||
return os.listdir(os.path.join(self.local, '.git/svn/refs/remotes/tags'))
|
||||
|
||||
def getref(self):
|
||||
self.checkrepo()
|
||||
p = subprocess.Popen(['git', 'svn', 'find-rev', 'HEAD'],
|
||||
stdout=subprocess.PIPE, cwd=self.local)
|
||||
return p.communicate()[0]
|
||||
|
||||
class vcs_svn(vcs):
|
||||
|
||||
def repotype(self):
|
||||
|
@ -321,6 +331,12 @@ class vcs_svn(vcs):
|
|||
self.userargs(), cwd=self.local) != 0:
|
||||
raise VCSException("Svn update failed")
|
||||
|
||||
def getref(self):
|
||||
p = subprocess.Popen(['svn', 'info'],
|
||||
stdout=subprocess.PIPE, cwd=self.local)
|
||||
for line in p.communicate()[0].splitlines():
|
||||
if line is not None and line.startswith('Last Changed Rev: '):
|
||||
return line[18:]
|
||||
|
||||
class vcs_hg(vcs):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue