maintainance: added update caches to mercurial.
This commit is contained in:
parent
3e5a351479
commit
d28e645e15
2 changed files with 16 additions and 1 deletions
|
|
@ -139,6 +139,15 @@ class HGVerify(MaintenanceTask):
|
|||
return res
|
||||
|
||||
|
||||
class HGUpdateCaches(MaintenanceTask):
|
||||
human_name = 'HG update caches'
|
||||
|
||||
def run(self):
|
||||
instance = self.db_repo.scm_instance()
|
||||
res = instance.hg_update_cache()
|
||||
return res
|
||||
|
||||
|
||||
class SVNVerify(MaintenanceTask):
|
||||
human_name = 'SVN Verify repo'
|
||||
|
||||
|
|
@ -153,7 +162,7 @@ class RepoMaintenance(object):
|
|||
Performs maintenance of repository based on it's type
|
||||
"""
|
||||
tasks = {
|
||||
'hg': [HGVerify],
|
||||
'hg': [HGVerify, HGUpdateCaches],
|
||||
'git': [GitFSCK, GitGC, GitRepack],
|
||||
'svn': [SVNVerify],
|
||||
}
|
||||
|
|
|
|||
|
|
@ -284,6 +284,12 @@ class MercurialRepository(BaseRepository):
|
|||
self._remote.invalidate_vcs_cache()
|
||||
return verify
|
||||
|
||||
def hg_update_cache(self):
|
||||
update_cache = self._remote.hg_update_cache()
|
||||
|
||||
self._remote.invalidate_vcs_cache()
|
||||
return update_cache
|
||||
|
||||
def get_common_ancestor(self, commit_id1, commit_id2, repo2):
|
||||
if commit_id1 == commit_id2:
|
||||
return commit_id1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue