You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2013/04/04 20:37:04 UTC

[02/50] [abbrv] git commit: [#4329] Denote whether refresh is for a new clone/fork

[#4329] Denote whether refresh is for a new clone/fork

Signed-off-by: Tim Van Steenburgh <tv...@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/1d70c920
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/1d70c920
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/1d70c920

Branch: refs/heads/db/5453
Commit: 1d70c9200541727aadb32c16bc0955f36d30c286
Parents: c06eeda
Author: Tim Van Steenburgh <tv...@gmail.com>
Authored: Tue Apr 2 15:34:08 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Wed Apr 3 16:24:06 2013 +0000

----------------------------------------------------------------------
 Allura/allura/model/repo_refresh.py |    4 ++--
 Allura/allura/model/repository.py   |    6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/1d70c920/Allura/allura/model/repo_refresh.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repo_refresh.py b/Allura/allura/model/repo_refresh.py
index d42def3..f15ec81 100644
--- a/Allura/allura/model/repo_refresh.py
+++ b/Allura/allura/model/repo_refresh.py
@@ -23,7 +23,7 @@ log = logging.getLogger(__name__)
 
 QSIZE=100
 
-def refresh_repo(repo, all_commits=False, notify=True):
+def refresh_repo(repo, all_commits=False, notify=True, new_clone=False):
     all_commit_ids = commit_ids = list(repo.all_commit_ids())
     if not commit_ids:
         # the repo is empty, no need to continue
@@ -113,7 +113,7 @@ def refresh_repo(repo, all_commits=False, notify=True):
 
 
     log.info('Refresh complete for %s', repo.full_fs_path)
-    g.post_event('repo_refreshed', len(commit_ids), all_commits)
+    g.post_event('repo_refreshed', len(commit_ids), all_commits, new_clone)
 
     # Send notifications
     if notify:

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/1d70c920/Allura/allura/model/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repository.py b/Allura/allura/model/repository.py
index 6ca3a31..9019375 100644
--- a/Allura/allura/model/repository.py
+++ b/Allura/allura/model/repository.py
@@ -314,7 +314,7 @@ class Repository(Artifact, ActivityObject):
         self._impl.clone_from(source)
         log.info('... %r cloned', self)
         g.post_event('repo_cloned', source_url, source_path)
-        self.refresh(notify=False)
+        self.refresh(notify=False, new_clone=True)
 
     def log(self, branch='master', offset=0, limit=10):
         return list(self._log(branch, offset, limit))
@@ -483,7 +483,7 @@ class Repository(Artifact, ActivityObject):
     def unknown_commit_ids(self):
         return unknown_commit_ids_repo(self.all_commit_ids())
 
-    def refresh(self, all_commits=False, notify=True):
+    def refresh(self, all_commits=False, notify=True, new_clone=False):
         '''Find any new commits in the repository and update'''
         try:
             log.info('... %r analyzing', self)
@@ -491,7 +491,7 @@ class Repository(Artifact, ActivityObject):
             session(self).flush(self)
             self._impl.refresh_heads()
             if asbool(tg.config.get('scm.new_refresh')):
-                refresh_repo(self, all_commits, notify)
+                refresh_repo(self, all_commits, notify, new_clone)
             for head in self.heads + self.branches + self.repo_tags:
                 ci = self.commit(head.object_id)
                 if ci is not None: