sync: Add support to dump a JSON event log of all sync events.
Change-Id: Id4852968ac1b2bf0093007cf2e5ca951ddab8b3b
diff --git a/project.py b/project.py
index 45ecfe3..269fd7e 100644
--- a/project.py
+++ b/project.py
@@ -323,13 +323,15 @@
pushUrl=None,
review=None,
revision=None,
- orig_name=None):
+ orig_name=None,
+ fetchUrl=None):
self.name = name
self.url = url
self.pushUrl = pushUrl
self.review = review
self.revision = revision
self.orig_name = orig_name
+ self.fetchUrl = fetchUrl
class RepoHook(object):
@@ -2876,13 +2878,14 @@
self.detach_head = detach_head
self.clean = True
+ self.recent_clean = True
def info(self, project, fmt, *args):
self._messages.append(_InfoMessage(project, fmt % args))
def fail(self, project, err=None):
self._failures.append(_Failure(project, err))
- self.clean = False
+ self._MarkUnclean()
def later1(self, project, what):
self._later_queue1.append(_Later(project, what))
@@ -2896,6 +2899,15 @@
self._PrintMessages()
return self.clean
+ def Recently(self):
+ recent_clean = self.recent_clean
+ self.recent_clean = True
+ return recent_clean
+
+ def _MarkUnclean(self):
+ self.clean = False
+ self.recent_clean = False
+
def _RunLater(self):
for q in ['_later_queue1', '_later_queue2']:
if not self._RunQueue(q):
@@ -2904,7 +2916,7 @@
def _RunQueue(self, queue):
for m in getattr(self, queue):
if not m.Run(self):
- self.clean = False
+ self._MarkUnclean()
return False
setattr(self, queue, [])
return True