From f6906876719a665819c603604603570363389d0d Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Sat, 18 Apr 2009 10:49:00 -0700 Subject: Only fetch repo once-per-day under normal 'repo sync' usage Its unlikely that a new version of repo will be delivered in any given day, so we now check only once every 24 hours to see if repo has been updated. This reduces the sync cost, as we no longer need to contact the repo distribution servers every time we do a sync. repo selfupdate can still be used to force a check. Signed-off-by: Shawn O. Pearce --- project.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'project.py') diff --git a/project.py b/project.py index 9f4512f6..f2825028 100644 --- a/project.py +++ b/project.py @@ -1349,6 +1349,14 @@ class MetaProject(Project): if base: self.revision = base + @property + def LastFetch(self): + try: + fh = os.path.join(self.gitdir, 'FETCH_HEAD') + return os.path.getmtime(fh) + except OSError: + return 0 + @property def HasChanges(self): """Has the remote received new commits not yet checked out? -- cgit v1.2.3-54-g00ecf