summaryrefslogtreecommitdiffstats
path: root/project.py
diff options
context:
space:
mode:
authorShawn O. Pearce <sop@google.com>2009-04-18 10:49:00 -0700
committerShawn O. Pearce <sop@google.com>2009-04-18 10:49:00 -0700
commitf6906876719a665819c603604603570363389d0d (patch)
treea309fe795eff059f5f464fd522fff74af148415b /project.py
parent336f7bd0ed70f5ee2595463b6bd8dd277e90c833 (diff)
downloadgit-repo-f6906876719a665819c603604603570363389d0d.tar.gz
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 <sop@google.com>
Diffstat (limited to 'project.py')
-rw-r--r--project.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/project.py b/project.py
index 9f4512f6..f2825028 100644
--- a/project.py
+++ b/project.py
@@ -1350,6 +1350,14 @@ class MetaProject(Project):
1350 self.revision = base 1350 self.revision = base
1351 1351
1352 @property 1352 @property
1353 def LastFetch(self):
1354 try:
1355 fh = os.path.join(self.gitdir, 'FETCH_HEAD')
1356 return os.path.getmtime(fh)
1357 except OSError:
1358 return 0
1359
1360 @property
1353 def HasChanges(self): 1361 def HasChanges(self):
1354 """Has the remote received new commits not yet checked out? 1362 """Has the remote received new commits not yet checked out?
1355 """ 1363 """