You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by jo...@apache.org on 2012/12/12 15:51:49 UTC

git commit: [#4691] Fixed compute_diffs for initial commit

Updated Branches:
  refs/heads/cj/4691 e69cb2fd1 -> 607e3e5cc


[#4691] Fixed compute_diffs for initial commit

Signed-off-by: Cory Johns <jo...@geek.net>


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

Branch: refs/heads/cj/4691
Commit: 607e3e5cc3bf300483e13bb76cedf5eddb85bde5
Parents: e69cb2f
Author: Cory Johns <jo...@geek.net>
Authored: Wed Dec 12 14:50:51 2012 +0000
Committer: Cory Johns <jo...@geek.net>
Committed: Wed Dec 12 14:50:51 2012 +0000

----------------------------------------------------------------------
 Allura/allura/model/repo_refresh.py |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/607e3e5c/Allura/allura/model/repo_refresh.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repo_refresh.py b/Allura/allura/model/repo_refresh.py
index c885dee..88c8709 100644
--- a/Allura/allura/model/repo_refresh.py
+++ b/Allura/allura/model/repo_refresh.py
@@ -346,6 +346,13 @@ def compute_diffs(repo_id, tree_cache, rhs_ci):
         for name, lhs_id, rhs_id in _diff_trees(lhs_tree, rhs_tree, tree_index):
             differences.append(
                 dict(name=name, lhs_id=lhs_id, rhs_id=rhs_id))
+    else:
+        # no parents, so everything in rhs is new
+        tree_index = _update_cache([], rhs_treesdoc.tree_ids)
+        rhs_tree = tree_index[rhs_ci.tree_id]
+        for name, lhs_id, rhs_id in _diff_trees(empty_tree, rhs_tree, tree_index):
+            differences.append(
+                dict(name=name, lhs_id=lhs_id, rhs_id=rhs_id))
     # Build the diffinfo
     di = DiffInfoDoc(dict(
             _id=rhs_ci._id,