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

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

Updated Branches:
  refs/heads/tv/4329 e4196fef3 -> 698b3ddb2


[#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/698b3ddb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/698b3ddb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/698b3ddb

Branch: refs/heads/tv/4329
Commit: 698b3ddb219ab82bb2fabe55fc07783e5073771e
Parents: e4196fe
Author: Tim Van Steenburgh <tv...@gmail.com>
Authored: Tue Apr 2 15:34:08 2013 +0000
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Tue Apr 2 15:34:08 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/698b3ddb/Allura/allura/model/repo_refresh.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repo_refresh.py b/Allura/allura/model/repo_refresh.py
index 69ff601..531aa1c 100644
--- a/Allura/allura/model/repo_refresh.py
+++ b/Allura/allura/model/repo_refresh.py
@@ -24,7 +24,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
@@ -112,7 +112,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/698b3ddb/Allura/allura/model/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repository.py b/Allura/allura/model/repository.py
index d6f843d..9c53d9c 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: