allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hei...@apache.org
Subject [1/5] allura git commit: [#7949] File listing in commites changed. Tests added. [Forced Update!]
Date Thu, 14 Apr 2016 22:29:57 GMT
Repository: allura
Updated Branches:
  refs/heads/hs/8071 66904737e -> eb61cbe7c (forced update)


[#7949] File listing in commites changed. Tests added.


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

Branch: refs/heads/hs/8071
Commit: da6ee3b541166af46c039d88dd401578f562b774
Parents: 1ffd75e
Author: dastanforever <pranav.sharma.nits@gmail.com>
Authored: Wed Mar 30 18:00:31 2016 +0530
Committer: Dave Brondsema <dave@brondsema.net>
Committed: Tue Apr 12 14:40:52 2016 -0400

----------------------------------------------------------------------
 Allura/allura/controllers/repository.py         |  10 +-
 Allura/allura/model/repository.py               |  10 +-
 ForgeGit/forgegit/model/git_repo.py             |   4 +-
 .../forgegit/tests/data/testgit.git/FETCH_HEAD  |   1 +
 .../tests/data/testui2.git/COMMIT_EDITMSG       |   1 +
 ForgeGit/forgegit/tests/data/testui2.git/HEAD   |   1 +
 ForgeGit/forgegit/tests/data/testui2.git/config |  11 ++
 .../forgegit/tests/data/testui2.git/description |   1 +
 .../testui2.git/hooks/applypatch-msg.sample     |  15 ++
 .../data/testui2.git/hooks/commit-msg.sample    |  24 +++
 .../data/testui2.git/hooks/post-update.sample   |   8 +
 .../testui2.git/hooks/pre-applypatch.sample     |  14 ++
 .../data/testui2.git/hooks/pre-commit.sample    |  49 ++++++
 .../data/testui2.git/hooks/pre-push.sample      |  54 ++++++
 .../data/testui2.git/hooks/pre-rebase.sample    | 169 +++++++++++++++++++
 .../testui2.git/hooks/prepare-commit-msg.sample |  36 ++++
 .../tests/data/testui2.git/hooks/update.sample  | 128 ++++++++++++++
 ForgeGit/forgegit/tests/data/testui2.git/index  | Bin 0 -> 320 bytes
 .../tests/data/testui2.git/info/exclude         |   6 +
 .../forgegit/tests/data/testui2.git/logs/HEAD   |   2 +
 .../data/testui2.git/logs/refs/heads/master     |   2 +
 .../testui2.git/logs/refs/remotes/origin/master |   1 +
 .../15/bd50be5571930e08d8d20c54aa2a0eb71730c7   | Bin 0 -> 18 bytes
 .../1b/df005764c6238b68410d0c4c327ce5553871c1   | Bin 0 -> 25 bytes
 .../2e/0d5278cbf7e102aa9f29750b293d263bf9ca4a   | Bin 0 -> 27 bytes
 .../8b/137891791fe96927ad78e64b0aad7bded08bdc   | Bin 0 -> 16 bytes
 .../8f/4d1149225c1ddac2bc832e867ad36f427c53c9   | Bin 0 -> 66 bytes
 .../97/047bf585ff6e445d90fbf52d8e49f9e398c9d7   | Bin 0 -> 140 bytes
 .../a7/d96eb118f6e902ce0429dfb19e23a344ab8944   | Bin 0 -> 137 bytes
 .../b9/69430766aace8931977ddd3bf81955ac634993   | Bin 0 -> 18 bytes
 .../e0/d7765883017040d53f9ca9c528940a4dd311c6   | Bin 0 -> 172 bytes
 .../e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391   | Bin 0 -> 15 bytes
 .../f3/b8ecb00c2ae175dbe94db6dd0f420965f1d94c   | Bin 0 -> 18 bytes
 .../fe/fe7d31a0d1d9ef1a2e974120955f02cde6e4aa   | Bin 0 -> 20 bytes
 .../tests/data/testui2.git/refs/heads/master    |   1 +
 .../data/testui2.git/refs/remotes/origin/master |   1 +
 .../tests/functional/test_controllers.py        |  29 ++++
 .../forgegit/tests/model/test_repository.py     |   4 +-
 38 files changed, 573 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/da6ee3b5/Allura/allura/controllers/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/repository.py b/Allura/allura/controllers/repository.py
index 3fc26dd..2f67783 100644
--- a/Allura/allura/controllers/repository.py
+++ b/Allura/allura/controllers/repository.py
@@ -563,7 +563,7 @@ class CommitBrowser(BaseController):
         tree = self._commit.tree
         limit, page, start = g.handle_paging(limit, page,
                                              default=self.DEFAULT_PAGE_LIMIT)
-        diffs = self._commit.paged_diffs(start=start, end=start + limit)
+        diffs = self._commit.paged_diffs(start=start, end=start + limit, onlyChangedFiles=True)
         result['artifacts'] = []
         for t in ('added', 'removed', 'changed', 'copied', 'renamed'):
             for f in diffs[t]:
@@ -577,6 +577,14 @@ class CommitBrowser(BaseController):
                 )
         count = diffs['total']
         result.update(dict(page=page, limit=limit, count=count))
+        # Sort the result['artifacts'] which is in format as below -
+        # [('added', u'aaa.txt', 'blob', True),
+        # ('added', u'eee.txt', 'blob', True),
+        # ('added', u'ggg.txt', 'blob', True),
+        # ('removed', u'bbb.txt', 'tree', None),
+        # ('removed', u'ddd.txt', 'tree', None),
+        # ('changed', u'ccc.txt', 'blob', True)]
+        result['artifacts'].sort(key=lambda x: x[1]['old'] if(type(x[1]) == dict) else x[1])
         return result
 
     @expose('jinja:allura:templates/repo/commit_basic.html')

http://git-wip-us.apache.org/repos/asf/allura/blob/da6ee3b5/Allura/allura/model/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repository.py b/Allura/allura/model/repository.py
index b39532b..9edbd58 100644
--- a/Allura/allura/model/repository.py
+++ b/Allura/allura/model/repository.py
@@ -326,7 +326,7 @@ class RepositoryImplementation(object):
         """
         raise NotImplementedError('get_changes')
 
-    def paged_diffs(self, commit_id, start=0, end=None):
+    def paged_diffs(self, commit_id, start=0, end=None, onlyChangedFiles=False):
         """
         Returns files touched by the commit, grouped by status (added, removed,
         and changed) and the total number of such files.  Paginates according
@@ -512,8 +512,8 @@ class Repository(Artifact, ActivityObject):
     def set_default_branch(self, name):
         return self._impl.set_default_branch(name)
 
-    def paged_diffs(self, commit_id, start=0, end=None):
-        return self._impl.paged_diffs(commit_id, start, end)
+    def paged_diffs(self, commit_id, start=0, end=None,  onlyChangedFiles=False):
+        return self._impl.paged_diffs(commit_id, start, end, onlyChangedFiles)
 
     def _log(self, rev, skip, limit):
         head = self.commit(rev)
@@ -1168,8 +1168,8 @@ class Commit(RepoObject, ActivityObject):
     def diffs(self):
         return self.paged_diffs()
 
-    def paged_diffs(self, start=0, end=None):
-        diffs = self.repo.paged_diffs(self._id, start, end)
+    def paged_diffs(self, start=0, end=None,  onlyChangedFiles=False):
+        diffs = self.repo.paged_diffs(self._id, start, end, onlyChangedFiles)
 
         return Object(
             added=sorted(diffs['added']),

http://git-wip-us.apache.org/repos/asf/allura/blob/da6ee3b5/ForgeGit/forgegit/model/git_repo.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/model/git_repo.py b/ForgeGit/forgegit/model/git_repo.py
index f74854a..82fa508 100644
--- a/ForgeGit/forgegit/model/git_repo.py
+++ b/ForgeGit/forgegit/model/git_repo.py
@@ -650,7 +650,7 @@ class GitImplementation(M.RepositoryImplementation):
             pretty='format:',
             max_count=1).splitlines()[1:]
 
-    def paged_diffs(self, commit_id, start=0, end=None):
+    def paged_diffs(self, commit_id, start=0, end=None, onlyChangedFiles=False):
         result = {'added': [], 'removed': [], 'changed': [], 'copied': [], 'renamed': []}
         cmd_args = ['--no-commit-id',
                     '--name-status',
@@ -660,6 +660,8 @@ class GitImplementation(M.RepositoryImplementation):
                     '-t',
                     '-z'  # don't escape filenames and use \x00 as fields delimiter
                     ]
+        if onlyChangedFiles:
+            cmd_args[4] = '-r'
         if asbool(tg.config.get('scm.commit.git.detect_copies', True)):
             cmd_args += ['-M', '-C']
 

http://git-wip-us.apache.org/repos/asf/allura/blob/da6ee3b5/ForgeGit/forgegit/tests/data/testgit.git/FETCH_HEAD
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testgit.git/FETCH_HEAD b/ForgeGit/forgegit/tests/data/testgit.git/FETCH_HEAD
new file mode 100644
index 0000000..0f81870
--- /dev/null
+++ b/ForgeGit/forgegit/tests/data/testgit.git/FETCH_HEAD
@@ -0,0 +1 @@
+1e146e67985dcd71c74de79613719bef7bddca4a		branch 'master' of /home/direwolf7/git/alluramine/ForgeGit/forgegit/tests/data/testgit

http://git-wip-us.apache.org/repos/asf/allura/blob/da6ee3b5/ForgeGit/forgegit/tests/data/testui2.git/COMMIT_EDITMSG
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testui2.git/COMMIT_EDITMSG b/ForgeGit/forgegit/tests/data/testui2.git/COMMIT_EDITMSG
new file mode 100644
index 0000000..78db77c
--- /dev/null
+++ b/ForgeGit/forgegit/tests/data/testui2.git/COMMIT_EDITMSG
@@ -0,0 +1 @@
+Tighter Commit.

http://git-wip-us.apache.org/repos/asf/allura/blob/da6ee3b5/ForgeGit/forgegit/tests/data/testui2.git/HEAD
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testui2.git/HEAD b/ForgeGit/forgegit/tests/data/testui2.git/HEAD
new file mode 100644
index 0000000..cb089cd
--- /dev/null
+++ b/ForgeGit/forgegit/tests/data/testui2.git/HEAD
@@ -0,0 +1 @@
+ref: refs/heads/master

http://git-wip-us.apache.org/repos/asf/allura/blob/da6ee3b5/ForgeGit/forgegit/tests/data/testui2.git/config
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testui2.git/config b/ForgeGit/forgegit/tests/data/testui2.git/config
new file mode 100644
index 0000000..03df209
--- /dev/null
+++ b/ForgeGit/forgegit/tests/data/testui2.git/config
@@ -0,0 +1,11 @@
+[core]
+	repositoryformatversion = 0
+	filemode = true
+	bare = true
+	logallrefupdates = true
+[remote "origin"]
+	url = /srv/git/p/testui2/code
+	fetch = +refs/heads/*:refs/remotes/origin/*
+[branch "master"]
+	remote = origin
+	merge = refs/heads/master

http://git-wip-us.apache.org/repos/asf/allura/blob/da6ee3b5/ForgeGit/forgegit/tests/data/testui2.git/description
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testui2.git/description b/ForgeGit/forgegit/tests/data/testui2.git/description
new file mode 100644
index 0000000..498b267
--- /dev/null
+++ b/ForgeGit/forgegit/tests/data/testui2.git/description
@@ -0,0 +1 @@
+Unnamed repository; edit this file 'description' to name the repository.

http://git-wip-us.apache.org/repos/asf/allura/blob/da6ee3b5/ForgeGit/forgegit/tests/data/testui2.git/hooks/applypatch-msg.sample
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testui2.git/hooks/applypatch-msg.sample b/ForgeGit/forgegit/tests/data/testui2.git/hooks/applypatch-msg.sample
new file mode 100755
index 0000000..8b2a2fe
--- /dev/null
+++ b/ForgeGit/forgegit/tests/data/testui2.git/hooks/applypatch-msg.sample
@@ -0,0 +1,15 @@
+#!/bin/sh
+#
+# An example hook script to check the commit log message taken by
+# applypatch from an e-mail message.
+#
+# The hook should exit with non-zero status after issuing an
+# appropriate message if it wants to stop the commit.  The hook is
+# allowed to edit the commit message file.
+#
+# To enable this hook, rename this file to "applypatch-msg".
+
+. git-sh-setup
+test -x "$GIT_DIR/hooks/commit-msg" &&
+	exec "$GIT_DIR/hooks/commit-msg" ${1+"$@"}
+:

http://git-wip-us.apache.org/repos/asf/allura/blob/da6ee3b5/ForgeGit/forgegit/tests/data/testui2.git/hooks/commit-msg.sample
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testui2.git/hooks/commit-msg.sample b/ForgeGit/forgegit/tests/data/testui2.git/hooks/commit-msg.sample
new file mode 100755
index 0000000..b58d118
--- /dev/null
+++ b/ForgeGit/forgegit/tests/data/testui2.git/hooks/commit-msg.sample
@@ -0,0 +1,24 @@
+#!/bin/sh
+#
+# An example hook script to check the commit log message.
+# Called by "git commit" with one argument, the name of the file
+# that has the commit message.  The hook should exit with non-zero
+# status after issuing an appropriate message if it wants to stop the
+# commit.  The hook is allowed to edit the commit message file.
+#
+# To enable this hook, rename this file to "commit-msg".
+
+# Uncomment the below to add a Signed-off-by line to the message.
+# Doing this in a hook is a bad idea in general, but the prepare-commit-msg
+# hook is more suited to it.
+#
+# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
+# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"
+
+# This example catches duplicate Signed-off-by lines.
+
+test "" = "$(grep '^Signed-off-by: ' "$1" |
+	 sort | uniq -c | sed -e '/^[ 	]*1[ 	]/d')" || {
+	echo >&2 Duplicate Signed-off-by lines.
+	exit 1
+}

http://git-wip-us.apache.org/repos/asf/allura/blob/da6ee3b5/ForgeGit/forgegit/tests/data/testui2.git/hooks/post-update.sample
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testui2.git/hooks/post-update.sample b/ForgeGit/forgegit/tests/data/testui2.git/hooks/post-update.sample
new file mode 100755
index 0000000..ec17ec1
--- /dev/null
+++ b/ForgeGit/forgegit/tests/data/testui2.git/hooks/post-update.sample
@@ -0,0 +1,8 @@
+#!/bin/sh
+#
+# An example hook script to prepare a packed repository for use over
+# dumb transports.
+#
+# To enable this hook, rename this file to "post-update".
+
+exec git update-server-info

http://git-wip-us.apache.org/repos/asf/allura/blob/da6ee3b5/ForgeGit/forgegit/tests/data/testui2.git/hooks/pre-applypatch.sample
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testui2.git/hooks/pre-applypatch.sample b/ForgeGit/forgegit/tests/data/testui2.git/hooks/pre-applypatch.sample
new file mode 100755
index 0000000..b1f187c
--- /dev/null
+++ b/ForgeGit/forgegit/tests/data/testui2.git/hooks/pre-applypatch.sample
@@ -0,0 +1,14 @@
+#!/bin/sh
+#
+# An example hook script to verify what is about to be committed
+# by applypatch from an e-mail message.
+#
+# The hook should exit with non-zero status after issuing an
+# appropriate message if it wants to stop the commit.
+#
+# To enable this hook, rename this file to "pre-applypatch".
+
+. git-sh-setup
+test -x "$GIT_DIR/hooks/pre-commit" &&
+	exec "$GIT_DIR/hooks/pre-commit" ${1+"$@"}
+:

http://git-wip-us.apache.org/repos/asf/allura/blob/da6ee3b5/ForgeGit/forgegit/tests/data/testui2.git/hooks/pre-commit.sample
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testui2.git/hooks/pre-commit.sample b/ForgeGit/forgegit/tests/data/testui2.git/hooks/pre-commit.sample
new file mode 100755
index 0000000..68d62d5
--- /dev/null
+++ b/ForgeGit/forgegit/tests/data/testui2.git/hooks/pre-commit.sample
@@ -0,0 +1,49 @@
+#!/bin/sh
+#
+# An example hook script to verify what is about to be committed.
+# Called by "git commit" with no arguments.  The hook should
+# exit with non-zero status after issuing an appropriate message if
+# it wants to stop the commit.
+#
+# To enable this hook, rename this file to "pre-commit".
+
+if git rev-parse --verify HEAD >/dev/null 2>&1
+then
+	against=HEAD
+else
+	# Initial commit: diff against an empty tree object
+	against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
+fi
+
+# If you want to allow non-ASCII filenames set this variable to true.
+allownonascii=$(git config --bool hooks.allownonascii)
+
+# Redirect output to stderr.
+exec 1>&2
+
+# Cross platform projects tend to avoid non-ASCII filenames; prevent
+# them from being added to the repository. We exploit the fact that the
+# printable range starts at the space character and ends with tilde.
+if [ "$allownonascii" != "true" ] &&
+	# Note that the use of brackets around a tr range is ok here, (it's
+	# even required, for portability to Solaris 10's /usr/bin/tr), since
+	# the square bracket bytes happen to fall in the designated range.
+	test $(git diff --cached --name-only --diff-filter=A -z $against |
+	  LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0
+then
+	cat <<\EOF
+Error: Attempt to add a non-ASCII file name.
+
+This can cause problems if you want to work with people on other platforms.
+
+To be portable it is advisable to rename the file.
+
+If you know what you are doing you can disable this check using:
+
+  git config hooks.allownonascii true
+EOF
+	exit 1
+fi
+
+# If there are whitespace errors, print the offending file names and fail.
+exec git diff-index --check --cached $against --

http://git-wip-us.apache.org/repos/asf/allura/blob/da6ee3b5/ForgeGit/forgegit/tests/data/testui2.git/hooks/pre-push.sample
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testui2.git/hooks/pre-push.sample b/ForgeGit/forgegit/tests/data/testui2.git/hooks/pre-push.sample
new file mode 100755
index 0000000..1f3bceb
--- /dev/null
+++ b/ForgeGit/forgegit/tests/data/testui2.git/hooks/pre-push.sample
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+# An example hook script to verify what is about to be pushed.  Called by "git
+# push" after it has checked the remote status, but before anything has been
+# pushed.  If this script exits with a non-zero status nothing will be pushed.
+#
+# This hook is called with the following parameters:
+#
+# $1 -- Name of the remote to which the push is being done
+# $2 -- URL to which the push is being done
+#
+# If pushing without using a named remote those arguments will be equal.
+#
+# Information about the commits which are being pushed is supplied as lines to
+# the standard input in the form:
+#
+#   <local ref> <local sha1> <remote ref> <remote sha1>
+#
+# This sample shows how to prevent push of commits where the log message starts
+# with "WIP" (work in progress).
+
+remote="$1"
+url="$2"
+
+z40=0000000000000000000000000000000000000000
+
+IFS=' '
+while read local_ref local_sha remote_ref remote_sha
+do
+	if [ "$local_sha" = $z40 ]
+	then
+		# Handle delete
+		:
+	else
+		if [ "$remote_sha" = $z40 ]
+		then
+			# New branch, examine all commits
+			range="$local_sha"
+		else
+			# Update to existing branch, examine new commits
+			range="$remote_sha..$local_sha"
+		fi
+
+		# Check for WIP commit
+		commit=`git rev-list -n 1 --grep '^WIP' "$range"`
+		if [ -n "$commit" ]
+		then
+			echo "Found WIP commit in $local_ref, not pushing"
+			exit 1
+		fi
+	fi
+done
+
+exit 0

http://git-wip-us.apache.org/repos/asf/allura/blob/da6ee3b5/ForgeGit/forgegit/tests/data/testui2.git/hooks/pre-rebase.sample
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testui2.git/hooks/pre-rebase.sample b/ForgeGit/forgegit/tests/data/testui2.git/hooks/pre-rebase.sample
new file mode 100755
index 0000000..33730ca
--- /dev/null
+++ b/ForgeGit/forgegit/tests/data/testui2.git/hooks/pre-rebase.sample
@@ -0,0 +1,169 @@
+#!/bin/sh
+#
+# Copyright (c) 2006, 2008 Junio C Hamano
+#
+# The "pre-rebase" hook is run just before "git rebase" starts doing
+# its job, and can prevent the command from running by exiting with
+# non-zero status.
+#
+# The hook is called with the following parameters:
+#
+# $1 -- the upstream the series was forked from.
+# $2 -- the branch being rebased (or empty when rebasing the current branch).
+#
+# This sample shows how to prevent topic branches that are already
+# merged to 'next' branch from getting rebased, because allowing it
+# would result in rebasing already published history.
+
+publish=next
+basebranch="$1"
+if test "$#" = 2
+then
+	topic="refs/heads/$2"
+else
+	topic=`git symbolic-ref HEAD` ||
+	exit 0 ;# we do not interrupt rebasing detached HEAD
+fi
+
+case "$topic" in
+refs/heads/??/*)
+	;;
+*)
+	exit 0 ;# we do not interrupt others.
+	;;
+esac
+
+# Now we are dealing with a topic branch being rebased
+# on top of master.  Is it OK to rebase it?
+
+# Does the topic really exist?
+git show-ref -q "$topic" || {
+	echo >&2 "No such branch $topic"
+	exit 1
+}
+
+# Is topic fully merged to master?
+not_in_master=`git rev-list --pretty=oneline ^master "$topic"`
+if test -z "$not_in_master"
+then
+	echo >&2 "$topic is fully merged to master; better remove it."
+	exit 1 ;# we could allow it, but there is no point.
+fi
+
+# Is topic ever merged to next?  If so you should not be rebasing it.
+only_next_1=`git rev-list ^master "^$topic" ${publish} | sort`
+only_next_2=`git rev-list ^master           ${publish} | sort`
+if test "$only_next_1" = "$only_next_2"
+then
+	not_in_topic=`git rev-list "^$topic" master`
+	if test -z "$not_in_topic"
+	then
+		echo >&2 "$topic is already up-to-date with master"
+		exit 1 ;# we could allow it, but there is no point.
+	else
+		exit 0
+	fi
+else
+	not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"`
+	/usr/bin/perl -e '
+		my $topic = $ARGV[0];
+		my $msg = "* $topic has commits already merged to public branch:\n";
+		my (%not_in_next) = map {
+			/^([0-9a-f]+) /;
+			($1 => 1);
+		} split(/\n/, $ARGV[1]);
+		for my $elem (map {
+				/^([0-9a-f]+) (.*)$/;
+				[$1 => $2];
+			} split(/\n/, $ARGV[2])) {
+			if (!exists $not_in_next{$elem->[0]}) {
+				if ($msg) {
+					print STDERR $msg;
+					undef $msg;
+				}
+				print STDERR " $elem->[1]\n";
+			}
+		}
+	' "$topic" "$not_in_next" "$not_in_master"
+	exit 1
+fi
+
+<<\DOC_END
+
+This sample hook safeguards topic branches that have been
+published from being rewound.
+
+The workflow assumed here is:
+
+ * Once a topic branch forks from "master", "master" is never
+   merged into it again (either directly or indirectly).
+
+ * Once a topic branch is fully cooked and merged into "master",
+   it is deleted.  If you need to build on top of it to correct
+   earlier mistakes, a new topic branch is created by forking at
+   the tip of the "master".  This is not strictly necessary, but
+   it makes it easier to keep your history simple.
+
+ * Whenever you need to test or publish your changes to topic
+   branches, merge them into "next" branch.
+
+The script, being an example, hardcodes the publish branch name
+to be "next", but it is trivial to make it configurable via
+$GIT_DIR/config mechanism.
+
+With this workflow, you would want to know:
+
+(1) ... if a topic branch has ever been merged to "next".  Young
+    topic branches can have stupid mistakes you would rather
+    clean up before publishing, and things that have not been
+    merged into other branches can be easily rebased without
+    affecting other people.  But once it is published, you would
+    not want to rewind it.
+
+(2) ... if a topic branch has been fully merged to "master".
+    Then you can delete it.  More importantly, you should not
+    build on top of it -- other people may already want to
+    change things related to the topic as patches against your
+    "master", so if you need further changes, it is better to
+    fork the topic (perhaps with the same name) afresh from the
+    tip of "master".
+
+Let's look at this example:
+
+		   o---o---o---o---o---o---o---o---o---o "next"
+		  /       /           /           /
+		 /   a---a---b A     /           /
+		/   /               /           /
+	       /   /   c---c---c---c B         /
+	      /   /   /             \         /
+	     /   /   /   b---b C     \       /
+	    /   /   /   /             \     /
+    ---o---o---o---o---o---o---o---o---o---o---o "master"
+
+
+A, B and C are topic branches.
+
+ * A has one fix since it was merged up to "next".
+
+ * B has finished.  It has been fully merged up to "master" and "next",
+   and is ready to be deleted.
+
+ * C has not merged to "next" at all.
+
+We would want to allow C to be rebased, refuse A, and encourage
+B to be deleted.
+
+To compute (1):
+
+	git rev-list ^master ^topic next
+	git rev-list ^master        next
+
+	if these match, topic has not merged in next at all.
+
+To compute (2):
+
+	git rev-list master..topic
+
+	if this is empty, it is fully merged to "master".
+
+DOC_END

http://git-wip-us.apache.org/repos/asf/allura/blob/da6ee3b5/ForgeGit/forgegit/tests/data/testui2.git/hooks/prepare-commit-msg.sample
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testui2.git/hooks/prepare-commit-msg.sample b/ForgeGit/forgegit/tests/data/testui2.git/hooks/prepare-commit-msg.sample
new file mode 100755
index 0000000..f093a02
--- /dev/null
+++ b/ForgeGit/forgegit/tests/data/testui2.git/hooks/prepare-commit-msg.sample
@@ -0,0 +1,36 @@
+#!/bin/sh
+#
+# An example hook script to prepare the commit log message.
+# Called by "git commit" with the name of the file that has the
+# commit message, followed by the description of the commit
+# message's source.  The hook's purpose is to edit the commit
+# message file.  If the hook fails with a non-zero status,
+# the commit is aborted.
+#
+# To enable this hook, rename this file to "prepare-commit-msg".
+
+# This hook includes three examples.  The first comments out the
+# "Conflicts:" part of a merge commit.
+#
+# The second includes the output of "git diff --name-status -r"
+# into the message, just before the "git status" output.  It is
+# commented because it doesn't cope with --amend or with squashed
+# commits.
+#
+# The third example adds a Signed-off-by line to the message, that can
+# still be edited.  This is rarely a good idea.
+
+case "$2,$3" in
+  merge,)
+    /usr/bin/perl -i.bak -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' "$1" ;;
+
+# ,|template,)
+#   /usr/bin/perl -i.bak -pe '
+#      print "\n" . `git diff --cached --name-status -r`
+#	 if /^#/ && $first++ == 0' "$1" ;;
+
+  *) ;;
+esac
+
+# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
+# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"

http://git-wip-us.apache.org/repos/asf/allura/blob/da6ee3b5/ForgeGit/forgegit/tests/data/testui2.git/hooks/update.sample
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testui2.git/hooks/update.sample b/ForgeGit/forgegit/tests/data/testui2.git/hooks/update.sample
new file mode 100755
index 0000000..d847583
--- /dev/null
+++ b/ForgeGit/forgegit/tests/data/testui2.git/hooks/update.sample
@@ -0,0 +1,128 @@
+#!/bin/sh
+#
+# An example hook script to blocks unannotated tags from entering.
+# Called by "git receive-pack" with arguments: refname sha1-old sha1-new
+#
+# To enable this hook, rename this file to "update".
+#
+# Config
+# ------
+# hooks.allowunannotated
+#   This boolean sets whether unannotated tags will be allowed into the
+#   repository.  By default they won't be.
+# hooks.allowdeletetag
+#   This boolean sets whether deleting tags will be allowed in the
+#   repository.  By default they won't be.
+# hooks.allowmodifytag
+#   This boolean sets whether a tag may be modified after creation. By default
+#   it won't be.
+# hooks.allowdeletebranch
+#   This boolean sets whether deleting branches will be allowed in the
+#   repository.  By default they won't be.
+# hooks.denycreatebranch
+#   This boolean sets whether remotely creating branches will be denied
+#   in the repository.  By default this is allowed.
+#
+
+# --- Command line
+refname="$1"
+oldrev="$2"
+newrev="$3"
+
+# --- Safety check
+if [ -z "$GIT_DIR" ]; then
+	echo "Don't run this script from the command line." >&2
+	echo " (if you want, you could supply GIT_DIR then run" >&2
+	echo "  $0 <ref> <oldrev> <newrev>)" >&2
+	exit 1
+fi
+
+if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then
+	echo "usage: $0 <ref> <oldrev> <newrev>" >&2
+	exit 1
+fi
+
+# --- Config
+allowunannotated=$(git config --bool hooks.allowunannotated)
+allowdeletebranch=$(git config --bool hooks.allowdeletebranch)
+denycreatebranch=$(git config --bool hooks.denycreatebranch)
+allowdeletetag=$(git config --bool hooks.allowdeletetag)
+allowmodifytag=$(git config --bool hooks.allowmodifytag)
+
+# check for no description
+projectdesc=$(sed -e '1q' "$GIT_DIR/description")
+case "$projectdesc" in
+"Unnamed repository"* | "")
+	echo "*** Project description file hasn't been set" >&2
+	exit 1
+	;;
+esac
+
+# --- Check types
+# if $newrev is 0000...0000, it's a commit to delete a ref.
+zero="0000000000000000000000000000000000000000"
+if [ "$newrev" = "$zero" ]; then
+	newrev_type=delete
+else
+	newrev_type=$(git cat-file -t $newrev)
+fi
+
+case "$refname","$newrev_type" in
+	refs/tags/*,commit)
+		# un-annotated tag
+		short_refname=${refname##refs/tags/}
+		if [ "$allowunannotated" != "true" ]; then
+			echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2
+			echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2
+			exit 1
+		fi
+		;;
+	refs/tags/*,delete)
+		# delete tag
+		if [ "$allowdeletetag" != "true" ]; then
+			echo "*** Deleting a tag is not allowed in this repository" >&2
+			exit 1
+		fi
+		;;
+	refs/tags/*,tag)
+		# annotated tag
+		if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1
+		then
+			echo "*** Tag '$refname' already exists." >&2
+			echo "*** Modifying a tag is not allowed in this repository." >&2
+			exit 1
+		fi
+		;;
+	refs/heads/*,commit)
+		# branch
+		if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then
+			echo "*** Creating a branch is not allowed in this repository" >&2
+			exit 1
+		fi
+		;;
+	refs/heads/*,delete)
+		# delete branch
+		if [ "$allowdeletebranch" != "true" ]; then
+			echo "*** Deleting a branch is not allowed in this repository" >&2
+			exit 1
+		fi
+		;;
+	refs/remotes/*,commit)
+		# tracking branch
+		;;
+	refs/remotes/*,delete)
+		# delete tracking branch
+		if [ "$allowdeletebranch" != "true" ]; then
+			echo "*** Deleting a tracking branch is not allowed in this repository" >&2
+			exit 1
+		fi
+		;;
+	*)
+		# Anything else (is there anything else?)
+		echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2
+		exit 1
+		;;
+esac
+
+# --- Finished
+exit 0

http://git-wip-us.apache.org/repos/asf/allura/blob/da6ee3b5/ForgeGit/forgegit/tests/data/testui2.git/index
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testui2.git/index b/ForgeGit/forgegit/tests/data/testui2.git/index
new file mode 100644
index 0000000..5892171
Binary files /dev/null and b/ForgeGit/forgegit/tests/data/testui2.git/index differ

http://git-wip-us.apache.org/repos/asf/allura/blob/da6ee3b5/ForgeGit/forgegit/tests/data/testui2.git/info/exclude
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testui2.git/info/exclude b/ForgeGit/forgegit/tests/data/testui2.git/info/exclude
new file mode 100644
index 0000000..a5196d1
--- /dev/null
+++ b/ForgeGit/forgegit/tests/data/testui2.git/info/exclude
@@ -0,0 +1,6 @@
+# git ls-files --others --exclude-from=.git/info/exclude
+# Lines that start with '#' are comments.
+# For a project mostly in C, the following would be a good set of
+# exclude patterns (uncomment them if you want to use them):
+# *.[oa]
+# *~

http://git-wip-us.apache.org/repos/asf/allura/blob/da6ee3b5/ForgeGit/forgegit/tests/data/testui2.git/logs/HEAD
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testui2.git/logs/HEAD b/ForgeGit/forgegit/tests/data/testui2.git/logs/HEAD
new file mode 100644
index 0000000..4b79b56
--- /dev/null
+++ b/ForgeGit/forgegit/tests/data/testui2.git/logs/HEAD
@@ -0,0 +1,2 @@
+0000000000000000000000000000000000000000 97047bf585ff6e445d90fbf52d8e49f9e398c9d7 dastanforever
<pranav.sharma.nits@gmail.com> 1459842846 +0530	commit (initial): First Commit.
+97047bf585ff6e445d90fbf52d8e49f9e398c9d7 e0d7765883017040d53f9ca9c528940a4dd311c6 dastanforever
<pranav.sharma.nits@gmail.com> 1459843317 +0530	commit: Tighter Commit.

http://git-wip-us.apache.org/repos/asf/allura/blob/da6ee3b5/ForgeGit/forgegit/tests/data/testui2.git/logs/refs/heads/master
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testui2.git/logs/refs/heads/master b/ForgeGit/forgegit/tests/data/testui2.git/logs/refs/heads/master
new file mode 100644
index 0000000..4b79b56
--- /dev/null
+++ b/ForgeGit/forgegit/tests/data/testui2.git/logs/refs/heads/master
@@ -0,0 +1,2 @@
+0000000000000000000000000000000000000000 97047bf585ff6e445d90fbf52d8e49f9e398c9d7 dastanforever
<pranav.sharma.nits@gmail.com> 1459842846 +0530	commit (initial): First Commit.
+97047bf585ff6e445d90fbf52d8e49f9e398c9d7 e0d7765883017040d53f9ca9c528940a4dd311c6 dastanforever
<pranav.sharma.nits@gmail.com> 1459843317 +0530	commit: Tighter Commit.

http://git-wip-us.apache.org/repos/asf/allura/blob/da6ee3b5/ForgeGit/forgegit/tests/data/testui2.git/logs/refs/remotes/origin/master
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testui2.git/logs/refs/remotes/origin/master b/ForgeGit/forgegit/tests/data/testui2.git/logs/refs/remotes/origin/master
new file mode 100644
index 0000000..841d570
--- /dev/null
+++ b/ForgeGit/forgegit/tests/data/testui2.git/logs/refs/remotes/origin/master
@@ -0,0 +1 @@
+0000000000000000000000000000000000000000 e0d7765883017040d53f9ca9c528940a4dd311c6 dastanforever
<pranav.sharma.nits@gmail.com> 1459846836 +0530	update by push

http://git-wip-us.apache.org/repos/asf/allura/blob/da6ee3b5/ForgeGit/forgegit/tests/data/testui2.git/objects/15/bd50be5571930e08d8d20c54aa2a0eb71730c7
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testui2.git/objects/15/bd50be5571930e08d8d20c54aa2a0eb71730c7
b/ForgeGit/forgegit/tests/data/testui2.git/objects/15/bd50be5571930e08d8d20c54aa2a0eb71730c7
new file mode 100644
index 0000000..f12d91f
Binary files /dev/null and b/ForgeGit/forgegit/tests/data/testui2.git/objects/15/bd50be5571930e08d8d20c54aa2a0eb71730c7
differ

http://git-wip-us.apache.org/repos/asf/allura/blob/da6ee3b5/ForgeGit/forgegit/tests/data/testui2.git/objects/1b/df005764c6238b68410d0c4c327ce5553871c1
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testui2.git/objects/1b/df005764c6238b68410d0c4c327ce5553871c1
b/ForgeGit/forgegit/tests/data/testui2.git/objects/1b/df005764c6238b68410d0c4c327ce5553871c1
new file mode 100644
index 0000000..a02c7be
Binary files /dev/null and b/ForgeGit/forgegit/tests/data/testui2.git/objects/1b/df005764c6238b68410d0c4c327ce5553871c1
differ

http://git-wip-us.apache.org/repos/asf/allura/blob/da6ee3b5/ForgeGit/forgegit/tests/data/testui2.git/objects/2e/0d5278cbf7e102aa9f29750b293d263bf9ca4a
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testui2.git/objects/2e/0d5278cbf7e102aa9f29750b293d263bf9ca4a
b/ForgeGit/forgegit/tests/data/testui2.git/objects/2e/0d5278cbf7e102aa9f29750b293d263bf9ca4a
new file mode 100644
index 0000000..ff02d1d
Binary files /dev/null and b/ForgeGit/forgegit/tests/data/testui2.git/objects/2e/0d5278cbf7e102aa9f29750b293d263bf9ca4a
differ

http://git-wip-us.apache.org/repos/asf/allura/blob/da6ee3b5/ForgeGit/forgegit/tests/data/testui2.git/objects/8b/137891791fe96927ad78e64b0aad7bded08bdc
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testui2.git/objects/8b/137891791fe96927ad78e64b0aad7bded08bdc
b/ForgeGit/forgegit/tests/data/testui2.git/objects/8b/137891791fe96927ad78e64b0aad7bded08bdc
new file mode 100644
index 0000000..9d8f605
Binary files /dev/null and b/ForgeGit/forgegit/tests/data/testui2.git/objects/8b/137891791fe96927ad78e64b0aad7bded08bdc
differ

http://git-wip-us.apache.org/repos/asf/allura/blob/da6ee3b5/ForgeGit/forgegit/tests/data/testui2.git/objects/8f/4d1149225c1ddac2bc832e867ad36f427c53c9
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testui2.git/objects/8f/4d1149225c1ddac2bc832e867ad36f427c53c9
b/ForgeGit/forgegit/tests/data/testui2.git/objects/8f/4d1149225c1ddac2bc832e867ad36f427c53c9
new file mode 100644
index 0000000..eb9f26c
Binary files /dev/null and b/ForgeGit/forgegit/tests/data/testui2.git/objects/8f/4d1149225c1ddac2bc832e867ad36f427c53c9
differ

http://git-wip-us.apache.org/repos/asf/allura/blob/da6ee3b5/ForgeGit/forgegit/tests/data/testui2.git/objects/97/047bf585ff6e445d90fbf52d8e49f9e398c9d7
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testui2.git/objects/97/047bf585ff6e445d90fbf52d8e49f9e398c9d7
b/ForgeGit/forgegit/tests/data/testui2.git/objects/97/047bf585ff6e445d90fbf52d8e49f9e398c9d7
new file mode 100644
index 0000000..2b0c667
Binary files /dev/null and b/ForgeGit/forgegit/tests/data/testui2.git/objects/97/047bf585ff6e445d90fbf52d8e49f9e398c9d7
differ

http://git-wip-us.apache.org/repos/asf/allura/blob/da6ee3b5/ForgeGit/forgegit/tests/data/testui2.git/objects/a7/d96eb118f6e902ce0429dfb19e23a344ab8944
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testui2.git/objects/a7/d96eb118f6e902ce0429dfb19e23a344ab8944
b/ForgeGit/forgegit/tests/data/testui2.git/objects/a7/d96eb118f6e902ce0429dfb19e23a344ab8944
new file mode 100644
index 0000000..db361a8
Binary files /dev/null and b/ForgeGit/forgegit/tests/data/testui2.git/objects/a7/d96eb118f6e902ce0429dfb19e23a344ab8944
differ

http://git-wip-us.apache.org/repos/asf/allura/blob/da6ee3b5/ForgeGit/forgegit/tests/data/testui2.git/objects/b9/69430766aace8931977ddd3bf81955ac634993
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testui2.git/objects/b9/69430766aace8931977ddd3bf81955ac634993
b/ForgeGit/forgegit/tests/data/testui2.git/objects/b9/69430766aace8931977ddd3bf81955ac634993
new file mode 100644
index 0000000..b0aea23
Binary files /dev/null and b/ForgeGit/forgegit/tests/data/testui2.git/objects/b9/69430766aace8931977ddd3bf81955ac634993
differ

http://git-wip-us.apache.org/repos/asf/allura/blob/da6ee3b5/ForgeGit/forgegit/tests/data/testui2.git/objects/e0/d7765883017040d53f9ca9c528940a4dd311c6
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testui2.git/objects/e0/d7765883017040d53f9ca9c528940a4dd311c6
b/ForgeGit/forgegit/tests/data/testui2.git/objects/e0/d7765883017040d53f9ca9c528940a4dd311c6
new file mode 100644
index 0000000..f468f50
Binary files /dev/null and b/ForgeGit/forgegit/tests/data/testui2.git/objects/e0/d7765883017040d53f9ca9c528940a4dd311c6
differ

http://git-wip-us.apache.org/repos/asf/allura/blob/da6ee3b5/ForgeGit/forgegit/tests/data/testui2.git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testui2.git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391
b/ForgeGit/forgegit/tests/data/testui2.git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391
new file mode 100644
index 0000000..7112238
Binary files /dev/null and b/ForgeGit/forgegit/tests/data/testui2.git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391
differ

http://git-wip-us.apache.org/repos/asf/allura/blob/da6ee3b5/ForgeGit/forgegit/tests/data/testui2.git/objects/f3/b8ecb00c2ae175dbe94db6dd0f420965f1d94c
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testui2.git/objects/f3/b8ecb00c2ae175dbe94db6dd0f420965f1d94c
b/ForgeGit/forgegit/tests/data/testui2.git/objects/f3/b8ecb00c2ae175dbe94db6dd0f420965f1d94c
new file mode 100644
index 0000000..2fb8931
Binary files /dev/null and b/ForgeGit/forgegit/tests/data/testui2.git/objects/f3/b8ecb00c2ae175dbe94db6dd0f420965f1d94c
differ

http://git-wip-us.apache.org/repos/asf/allura/blob/da6ee3b5/ForgeGit/forgegit/tests/data/testui2.git/objects/fe/fe7d31a0d1d9ef1a2e974120955f02cde6e4aa
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testui2.git/objects/fe/fe7d31a0d1d9ef1a2e974120955f02cde6e4aa
b/ForgeGit/forgegit/tests/data/testui2.git/objects/fe/fe7d31a0d1d9ef1a2e974120955f02cde6e4aa
new file mode 100644
index 0000000..1110505
Binary files /dev/null and b/ForgeGit/forgegit/tests/data/testui2.git/objects/fe/fe7d31a0d1d9ef1a2e974120955f02cde6e4aa
differ

http://git-wip-us.apache.org/repos/asf/allura/blob/da6ee3b5/ForgeGit/forgegit/tests/data/testui2.git/refs/heads/master
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testui2.git/refs/heads/master b/ForgeGit/forgegit/tests/data/testui2.git/refs/heads/master
new file mode 100644
index 0000000..30b2c10
--- /dev/null
+++ b/ForgeGit/forgegit/tests/data/testui2.git/refs/heads/master
@@ -0,0 +1 @@
+e0d7765883017040d53f9ca9c528940a4dd311c6

http://git-wip-us.apache.org/repos/asf/allura/blob/da6ee3b5/ForgeGit/forgegit/tests/data/testui2.git/refs/remotes/origin/master
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testui2.git/refs/remotes/origin/master b/ForgeGit/forgegit/tests/data/testui2.git/refs/remotes/origin/master
new file mode 100644
index 0000000..30b2c10
--- /dev/null
+++ b/ForgeGit/forgegit/tests/data/testui2.git/refs/remotes/origin/master
@@ -0,0 +1 @@
+e0d7765883017040d53f9ca9c528940a4dd311c6

http://git-wip-us.apache.org/repos/asf/allura/blob/da6ee3b5/ForgeGit/forgegit/tests/functional/test_controllers.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/functional/test_controllers.py b/ForgeGit/forgegit/tests/functional/test_controllers.py
index 6d05094..8e09047 100644
--- a/ForgeGit/forgegit/tests/functional/test_controllers.py
+++ b/ForgeGit/forgegit/tests/functional/test_controllers.py
@@ -75,6 +75,35 @@ class _TestCase(TestController):
         ThreadLocalORMSession.flush_all()
 
 
+class TestUIController(TestController):
+    def setUp(self):
+        super(TestUIController, self).setUp()
+        self.setup_with_tools()
+
+    @with_git
+    def setup_with_tools(self):
+        h.set_context('test', 'src-git', neighborhood='Projects')
+        repo_dir = pkg_resources.resource_filename('forgegit', 'tests/data')
+        c.app.repo.fs_path = repo_dir
+        c.app.repo.name = 'testui2.git'
+        c.app.repo.status = 'ready'
+        self.repo = c.app.repo
+        self.repo.refresh()
+        self.rev = self.repo.commit('HEAD')
+        ThreadLocalORMSession.flush_all()
+        ThreadLocalORMSession.close_all()
+
+    def test_repo_loading(self):
+        resp = self.app.get('/src-git/').follow().follow()
+        assert '<a href="/p/test/src-git/ci/e0d7765883017040d53f9ca9c528940a4dd311c6/">'
in resp
+
+    def test_status_html(self):
+        resp = self.app.get('/src-git/ci/e0d7765883017040d53f9ca9c528940a4dd311c6/')
+        sortedCommits = resp.html.findAll('td')
+        actualCommit = ['added', 'aaa.txt', 'removed', 'bbb.txt', 'changed', 'ccc.txt', 'removed',
'ddd.txt', 'added', 'eee.txt', 'added', 'ggg.txt']
+        for i, item in enumerate(sortedCommits):
+            assert_equal(actualCommit[i], ''.join(item.findAll(text=True)).strip())
+
 class TestRootController(_TestCase):
     @with_tool('test', 'Git', 'weird-chars', 'WeirdChars', type='git')
     def _setup_weird_chars_repo(self):

http://git-wip-us.apache.org/repos/asf/allura/blob/da6ee3b5/ForgeGit/forgegit/tests/model/test_repository.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/model/test_repository.py b/ForgeGit/forgegit/tests/model/test_repository.py
index 7c15bae..c281603 100644
--- a/ForgeGit/forgegit/tests/model/test_repository.py
+++ b/ForgeGit/forgegit/tests/model/test_repository.py
@@ -681,11 +681,11 @@ class TestGitRepo(unittest.TestCase, RepoImplTestBase):
         # spaces and unicode filenames
         diffs = repo.paged_diffs('407950e8fba4dbc108ffbce0128ed1085c52cfd7')
         expected = {
-            'added': [u'with space.txt', u'привіт.txt'],
             'removed': [],
             'changed': [],
-            'copied': [],
             'renamed': [],
+            'added': [u'with space.txt', u'привіт.txt'],
+            'copied': [],
             'total': 2,
         }
         assert_equals(diffs, expected)


Mime
View raw message