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/09/12 22:51:51 UTC
[01/29] git commit: [#6526] bump Google Code & Trac Wiki importer
versions for their changes
Updated Branches:
refs/heads/db/6640 f3d3166df -> 4eb88f5b6
refs/heads/tv/6457 04851fa4c -> 22e766626
[#6526] bump Google Code & Trac Wiki importer versions for their changes
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/10cb90c7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/10cb90c7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/10cb90c7
Branch: refs/heads/tv/6457
Commit: 10cb90c712a79fb8a64d5f7dbcc0aaa5b7132b04
Parents: eceab84
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Wed Aug 28 17:08:01 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Wed Aug 28 17:08:01 2013 +0000
----------------------------------------------------------------------
requirements-sf.txt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/10cb90c7/requirements-sf.txt
----------------------------------------------------------------------
diff --git a/requirements-sf.txt b/requirements-sf.txt
index a77c839..4e00d83 100644
--- a/requirements-sf.txt
+++ b/requirements-sf.txt
@@ -6,7 +6,7 @@ kombu==1.0.4
coverage==3.5a1-20110413
ForgeHg==0.1.15
ForgePastebin==0.2.7
-GoogleCodeWikiImporter==0.2.0
+GoogleCodeWikiImporter==0.3.0
mechanize==0.2.4
mercurial==1.4.3
MySQL-python==1.2.3c1
@@ -20,7 +20,7 @@ wsgipreload==1.2
pyzmq==2.1.7
html2text==3.200.3dev-20121112
PyMollom==0.1
-TracWikiImporter==0.1.0
+TracWikiImporter==0.2.0
# use version built from https://github.com/johnsca/GitPython/commits/tv/6000
# for unmerged fixes for [#5411], [#6000], and [#6078]
[03/29] git commit: put middleware back in proper place so error
pages work correctly (bug introduced in 9a1363)
Posted by tv...@apache.org.
put middleware back in proper place so error pages work correctly (bug introduced in 9a1363)
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/6769dc23
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/6769dc23
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/6769dc23
Branch: refs/heads/tv/6457
Commit: 6769dc236d4002e9da51c3cb99439c233fb8a8b2
Parents: 1581f29
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Wed Aug 28 19:02:12 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Wed Aug 28 19:05:47 2013 +0000
----------------------------------------------------------------------
Allura/allura/config/middleware.py | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/6769dc23/Allura/allura/config/middleware.py
----------------------------------------------------------------------
diff --git a/Allura/allura/config/middleware.py b/Allura/allura/config/middleware.py
index 1e9b0c7..7395f93 100644
--- a/Allura/allura/config/middleware.py
+++ b/Allura/allura/config/middleware.py
@@ -161,15 +161,17 @@ def _make_core_app(root, global_conf, full_stack=True, **app_conf):
# streaming=true ensures they won't be cleaned up till
# the WSGI application's iterator is exhausted
app = RegistryManager(app, streaming=True)
- # Make sure that the wsgi.scheme is set appropriately when we
- # have the funky HTTP_X_SFINC_SSL environ var
- if asbool(app_conf.get('auth.method', 'local')=='sfx'):
- app = set_scheme_middleware(app)
# "task" wsgi would get a 2nd request to /error/document if we used this middleware
if config.get('override_root') != 'task':
# Converts exceptions to HTTP errors, shows traceback in debug mode
tg.error.footer_html = '<!-- %s %s -->' # don't use TG footer with extra CSS & images that take time to load
app = tg.error.ErrorHandler(app, global_conf, **config['pylons.errorware'])
+
+ # Make sure that the wsgi.scheme is set appropriately when we
+ # have the funky HTTP_X_SFINC_SSL environ var
+ if asbool(app_conf.get('auth.method', 'local')=='sfx'):
+ app = set_scheme_middleware(app)
+
# Redirect some status codes to /error/document
if asbool(config['debug']):
app = StatusCodeRedirect(app, base_config.handle_status_codes)
[24/29] git commit: [#6541] Override url in AuditLog on tool import
Posted by tv...@apache.org.
[#6541] Override url in AuditLog on tool import
Signed-off-by: Cory Johns <cj...@slashdotmedia.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/89cfb5ab
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/89cfb5ab
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/89cfb5ab
Branch: refs/heads/db/6640
Commit: 89cfb5abd76efb0e8ae999621dc377d222b0c8a1
Parents: 44b2a36
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Fri Sep 6 18:17:05 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Mon Sep 9 20:27:30 2013 +0000
----------------------------------------------------------------------
ForgeImporters/forgeimporters/google/code.py | 2 +-
ForgeImporters/forgeimporters/google/tests/test_code.py | 3 ++-
ForgeImporters/forgeimporters/google/tracker.py | 1 +
ForgeImporters/forgeimporters/tests/google/test_tracker.py | 3 ++-
ForgeImporters/forgeimporters/trac/tests/test_tickets.py | 3 ++-
ForgeImporters/forgeimporters/trac/tickets.py | 2 +-
6 files changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/89cfb5ab/ForgeImporters/forgeimporters/google/code.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/google/code.py b/ForgeImporters/forgeimporters/google/code.py
index c5f34cd..134ecb6 100644
--- a/ForgeImporters/forgeimporters/google/code.py
+++ b/ForgeImporters/forgeimporters/google/code.py
@@ -178,6 +178,6 @@ class GoogleRepoImporter(ToolImporter):
'import tool %s from %s on %s' % (
app.config.options.mount_point,
project_name, self.source,
- ), project=project, user=user)
+ ), project=project, user=user, url=app.url)
g.post_event('project_updated')
return app
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/89cfb5ab/ForgeImporters/forgeimporters/google/tests/test_code.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/google/tests/test_code.py b/ForgeImporters/forgeimporters/google/tests/test_code.py
index 4028076..806a004 100644
--- a/ForgeImporters/forgeimporters/google/tests/test_code.py
+++ b/ForgeImporters/forgeimporters/google/tests/test_code.py
@@ -67,6 +67,7 @@ class TestGoogleRepoImporter(TestCase):
u = Mock(name='c.user')
app = p.install_app.return_value
app.config.options.mount_point = 'code'
+ app.url = 'foo'
GoogleRepoImporter().import_tool(p, u, project_name='project_name')
get_repo_url.assert_called_once_with('project_name', 'git')
p.install_app.assert_called_once_with('Git',
@@ -80,7 +81,7 @@ class TestGoogleRepoImporter(TestCase):
)
M.AuditLog.log.assert_called_once_with(
'import tool code from project_name on Google Code',
- project=p, user=u)
+ project=p, user=u, url='foo')
g.post_event.assert_called_once_with('project_updated')
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/89cfb5ab/ForgeImporters/forgeimporters/google/tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/google/tracker.py b/ForgeImporters/forgeimporters/google/tracker.py
index cf6067e..9c259dd 100644
--- a/ForgeImporters/forgeimporters/google/tracker.py
+++ b/ForgeImporters/forgeimporters/google/tracker.py
@@ -147,6 +147,7 @@ class GoogleCodeTrackerImporter(ToolImporter):
),
project=project,
user=user,
+ url=app.url,
)
g.post_event('project_updated')
app.globals.invalidate_bin_counts()
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/89cfb5ab/ForgeImporters/forgeimporters/tests/google/test_tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/tests/google/test_tracker.py b/ForgeImporters/forgeimporters/tests/google/test_tracker.py
index 8f434df..d795bab 100644
--- a/ForgeImporters/forgeimporters/tests/google/test_tracker.py
+++ b/ForgeImporters/forgeimporters/tests/google/test_tracker.py
@@ -48,6 +48,7 @@ class TestTrackerImporter(TestCase):
'project_name': 'project_name',
}
app.config.options.get = lambda *a: getattr(app.config.options, *a)
+ app.url = 'foo'
issues = gpe.iter_issues.return_value = [(50, mock.Mock()), (100, mock.Mock())]
tickets = TM.Ticket.side_effect = [mock.Mock(), mock.Mock()]
@@ -91,7 +92,7 @@ class TestTrackerImporter(TestCase):
self.assertEqual(app.globals.last_ticket_num, 100)
M.AuditLog.log.assert_called_once_with(
'import tool mount_point from project_name on Google Code',
- project=project, user=user)
+ project=project, user=user, url='foo')
g.post_event.assert_called_once_with('project_updated')
app.globals.invalidate_bin_counts.assert_called_once_with()
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/89cfb5ab/ForgeImporters/forgeimporters/trac/tests/test_tickets.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/trac/tests/test_tickets.py b/ForgeImporters/forgeimporters/trac/tests/test_tickets.py
index 2e0c199..92e7854 100644
--- a/ForgeImporters/forgeimporters/trac/tests/test_tickets.py
+++ b/ForgeImporters/forgeimporters/trac/tests/test_tickets.py
@@ -48,6 +48,7 @@ class TestTracTicketImporter(TestCase):
app = Mock(name='ForgeTrackerApp')
app.config.options.mount_point = 'bugs'
app.config.options.get = lambda *a: getattr(app.config.options, *a)
+ app.url = 'foo'
project = Mock(name='Project', shortname='myproject')
project.install_app.return_value = app
user = Mock(name='User', _id='id')
@@ -78,7 +79,7 @@ class TestTracTicketImporter(TestCase):
validate=False)
AuditLog.log.assert_called_once_with(
'import tool bugs from http://example.com/trac/url/',
- project=project, user=user)
+ project=project, user=user, url='foo')
g.post_event.assert_called_once_with('project_updated')
@patch('forgeimporters.trac.tickets.session')
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/89cfb5ab/ForgeImporters/forgeimporters/trac/tickets.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/trac/tickets.py b/ForgeImporters/forgeimporters/trac/tickets.py
index e5238e3..9e4f493 100644
--- a/ForgeImporters/forgeimporters/trac/tickets.py
+++ b/ForgeImporters/forgeimporters/trac/tickets.py
@@ -141,7 +141,7 @@ class TracTicketImporter(ToolImporter):
app.config.options.mount_point,
trac_url,
),
- project=project, user=user,
+ project=project, user=user, url=app.url,
)
g.post_event('project_updated')
return app
[05/29] git commit: [#6595] Make 'tarball' controller handle GET and
POST
Posted by tv...@apache.org.
[#6595] Make 'tarball' controller handle GET and POST
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/f9679555
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/f9679555
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/f9679555
Branch: refs/heads/tv/6457
Commit: f9679555198e5246fbbcf003e44d39d9f94e13f9
Parents: 6769dc2
Author: Tim Van Steenburgh <tv...@gmail.com>
Authored: Mon Aug 26 14:00:08 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Wed Aug 28 19:40:32 2013 +0000
----------------------------------------------------------------------
Allura/allura/controllers/repository.py | 12 ++---
Allura/allura/templates/repo/tarball.html | 13 ++++--
.../tests/functional/test_controllers.py | 10 +++-
.../tests/functional/test_controllers.py | 49 ++++++++++----------
4 files changed, 46 insertions(+), 38 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/f9679555/Allura/allura/controllers/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/repository.py b/Allura/allura/controllers/repository.py
index f984a91..14ce77a 100644
--- a/Allura/allura/controllers/repository.py
+++ b/Allura/allura/controllers/repository.py
@@ -20,7 +20,7 @@ import json
import logging
import re
import difflib
-from urllib import quote, unquote
+from urllib import quote, unquote, quote_plus
from collections import defaultdict
from itertools import islice
@@ -459,24 +459,24 @@ class CommitBrowser(BaseController):
result.update(self._commit.context())
return result
- @require_post()
@expose('jinja:allura:templates/repo/tarball.html')
def tarball(self, **kw):
- path = kw.pop('path', None)
+ path = request.params.get('path')
if not asbool(tg.config.get('scm.repos.tarball.enable', False)):
raise exc.HTTPNotFound()
rev = self._commit.url().split('/')[-2]
status = c.app.repo.get_tarball_status(rev, path)
- if status is None:
+ if status is None and request.method == 'POST':
allura.tasks.repo_tasks.tarball.post(revision=rev, path=path)
- return dict(commit=self._commit, revision=rev, status=status)
+ redirect('tarball' + '?path={0}'.format(path) if path else '')
+ return dict(commit=self._commit, revision=rev, status=status or 'na')
@expose('json:')
def tarball_status(self, path=None, **kw):
if not asbool(tg.config.get('scm.repos.tarball.enable', False)):
raise exc.HTTPNotFound()
rev = self._commit.url().split('/')[-2]
- return dict(status=c.app.repo.get_tarball_status(rev, path))
+ return dict(status=c.app.repo.get_tarball_status(rev, path) or 'na')
@expose('jinja:allura:templates/repo/log.html')
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/f9679555/Allura/allura/templates/repo/tarball.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/repo/tarball.html b/Allura/allura/templates/repo/tarball.html
index e4a9cad..805293c 100644
--- a/Allura/allura/templates/repo/tarball.html
+++ b/Allura/allura/templates/repo/tarball.html
@@ -53,13 +53,14 @@ Commit <a href="{{commit.url()}}">{{commit.shorthand_id()}}</a> {{commit_labels(
left: 10 // Left position relative to parent in px
};
var spinner = new Spinner(opts).spin($('#snapshot_status')[0]);
- var delay = 5000;
+ var delay = 500;
// Check tarball status every 5 seconds
function check_status() {
$.get('{{commit.url()}}tarball_status?path={{path}}', function(data) {
- if (data.status === 'ready') {
+ if (data.status !== 'na') {
spinner.stop();
- $('#snapshot_status h2').toggle();
+ $('#snapshot_status h2').hide();
+ $('#snapshot_status h2.' + data.status).show();
{% if 'no-redirect' not in request.params %}
window.location.href = '{{c.app.repo.tarball_url(revision, path)}}';
{% endif %}
@@ -82,6 +83,7 @@ Commit <a href="{{commit.url()}}">{{commit.shorthand_id()}}</a> {{commit_labels(
<div id='snapshot_status'>
<h2 class="busy">Generating snapshot...</h2>
<h2 class="ready">Your download will begin shortly, or use this <a href="{{c.app.repo.tarball_url(revision, path)}}">direct link</a>.</h2>
+ <h2 class="na">Checking snapshot status...</h2>
</div>
{% endblock %}
@@ -89,9 +91,10 @@ Commit <a href="{{commit.url()}}">{{commit.shorthand_id()}}</a> {{commit_labels(
<style type="text/css">
#snapshot_status h2 {
padding-left: 33px;
- }
- #snapshot_status .{{ 'busy' if status == 'ready' else 'ready' }} {
display: none;
}
+ #snapshot_status .{{ status }} {
+ display: block;
+ }
</style>
{% endblock %}
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/f9679555/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 1222429..c05ef94 100644
--- a/ForgeGit/forgegit/tests/functional/test_controllers.py
+++ b/ForgeGit/forgegit/tests/functional/test_controllers.py
@@ -53,6 +53,8 @@ class _TestCase(TestController):
# ThreadLocalORMSession.close_all()
h.set_context('test', 'src-git', neighborhood='Projects')
c.app.repo.refresh()
+ if os.path.isdir(c.app.repo.tarball_path):
+ shutil.rmtree(c.app.repo.tarball_path)
ThreadLocalORMSession.flush_all()
# ThreadLocalORMSession.close_all()
@@ -343,14 +345,18 @@ class TestRootController(_TestCase):
r = self.app.get(ci + 'tree/')
assert '/p/test/src-git/ci/master/tarball' in r
assert 'Download Snapshot' in r
- r = self.app.post('/p/test/src-git/ci/master/tarball')
- assert 'Generating snapshot...' in r
+ r = self.app.post('/p/test/src-git/ci/master/tarball').follow()
+ assert 'Checking snapshot status...' in r
+ r = self.app.get('/p/test/src-git/ci/master/tarball')
+ assert 'Checking snapshot status...' in r
M.MonQTask.run_ready()
ThreadLocalORMSession.flush_all()
r = self.app.get(ci + 'tarball_status')
assert '{"status": "ready"}' in r
r = self.app.get('/p/test/src-git/ci/master/tarball_status')
assert '{"status": "ready"}' in r
+ r = self.app.get('/p/test/src-git/ci/master/tarball')
+ assert 'Your download will begin shortly' in r
def test_tarball_link_in_subdirs(self):
'''Go to repo subdir and check 'Download Snapshot' link'''
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/f9679555/ForgeSVN/forgesvn/tests/functional/test_controllers.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/functional/test_controllers.py b/ForgeSVN/forgesvn/tests/functional/test_controllers.py
index cc37545..16fd989 100644
--- a/ForgeSVN/forgesvn/tests/functional/test_controllers.py
+++ b/ForgeSVN/forgesvn/tests/functional/test_controllers.py
@@ -38,29 +38,24 @@ class SVNTestController(TestController):
TestController.setUp(self)
self.setup_with_tools()
- @with_svn
- @with_tool('test', 'SVN', 'svn-tags', 'SVN with tags')
- def setup_with_tools(self):
- h.set_context('test', 'src', neighborhood='Projects')
+ def _make_app(self, mount_point, name):
+ h.set_context('test', mount_point, neighborhood='Projects')
repo_dir = pkg_resources.resource_filename(
'forgesvn', 'tests/data/')
c.app.repo.fs_path = repo_dir
c.app.repo.status = 'ready'
- c.app.repo.name = 'testsvn'
- ThreadLocalORMSession.flush_all()
- ThreadLocalORMSession.close_all()
- h.set_context('test', 'src', neighborhood='Projects')
- c.app.repo.refresh()
- ThreadLocalORMSession.flush_all()
- ThreadLocalORMSession.close_all()
- h.set_context('test', 'svn-tags', neighborhood='Projects')
- c.app.repo.fs_path = repo_dir
- c.app.repo.status = 'ready'
- c.app.repo.name = 'testsvn-trunk-tags-branches'
+ c.app.repo.name = name
c.app.repo.refresh()
+ if os.path.isdir(c.app.repo.tarball_path):
+ shutil.rmtree(c.app.repo.tarball_path)
ThreadLocalORMSession.flush_all()
ThreadLocalORMSession.close_all()
- h.set_context('test', 'src', neighborhood='Projects')
+
+ @with_svn
+ @with_tool('test', 'SVN', 'svn-tags', 'SVN with tags')
+ def setup_with_tools(self):
+ self._make_app('svn-tags', 'testsvn-trunk-tags-branches')
+ self._make_app('src', 'testsvn')
class TestRootController(SVNTestController):
@@ -194,12 +189,16 @@ class TestRootController(SVNTestController):
def test_tarball(self):
r = self.app.get('/src/3/tree/')
assert 'Download Snapshot' in r
- r = self.app.post('/src/3/tarball')
- assert 'Generating snapshot...' in r
+ r = self.app.post('/src/3/tarball').follow()
+ assert 'Checking snapshot status...' in r
+ r = self.app.get('/src/3/tarball')
+ assert 'Checking snapshot status...' in r
M.MonQTask.run_ready()
ThreadLocalORMSession.flush_all()
r = self.app.get('/src/3/tarball_status')
assert '{"status": "ready"}' in r
+ r = self.app.get('/src/3/tarball')
+ assert 'Your download will begin shortly' in r
@onlyif(os.path.exists(tg.config.get('scm.repos.tarball.zip_binary', '/usr/bin/zip')), 'zip binary is missing')
def test_tarball_tags_aware(self):
@@ -217,23 +216,23 @@ class TestRootController(SVNTestController):
assert_equal(form.find('input', attrs=dict(name='path')).get('value'), '/tags/tag-1.0')
r = self.app.get('/p/test/svn-tags/19/tarball_status?path=/tags/tag-1.0')
- assert_equal(r.json['status'], None)
- r = self.app.post('/p/test/svn-tags/19/tarball', dict(path='/tags/tag-1.0'))
- assert 'Generating snapshot...' in r
+ assert_equal(r.json['status'], 'na')
+ r = self.app.post('/p/test/svn-tags/19/tarball', dict(path='/tags/tag-1.0')).follow()
+ assert 'Checking snapshot status...' in r
M.MonQTask.run_ready()
r = self.app.get('/p/test/svn-tags/19/tarball_status?path=/tags/tag-1.0')
assert_equal(r.json['status'], 'ready')
r = self.app.get('/p/test/svn-tags/19/tarball_status?path=/trunk')
- assert_equal(r.json['status'], None)
- r = self.app.post('/p/test/svn-tags/19/tarball', dict(path='/trunk/'))
- assert 'Generating snapshot...' in r
+ assert_equal(r.json['status'], 'na')
+ r = self.app.post('/p/test/svn-tags/19/tarball', dict(path='/trunk/')).follow()
+ assert 'Checking snapshot status...' in r
M.MonQTask.run_ready()
r = self.app.get('/p/test/svn-tags/19/tarball_status?path=/trunk')
assert_equal(r.json['status'], 'ready')
r = self.app.get('/p/test/svn-tags/19/tarball_status?path=/branches/aaa/')
- assert_equal(r.json['status'], None)
+ assert_equal(r.json['status'], 'na')
# All of the following also should be ready because...
# ...this is essentially the same as trunk snapshot
[16/29] git commit: [#6457] Make way for extending tmpl to hide mount
fields
Posted by tv...@apache.org.
[#6457] Make way for extending tmpl to hide mount fields
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/e795553b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/e795553b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/e795553b
Branch: refs/heads/tv/6457
Commit: e795553bf58f7a243a6a00a766467d660b522eaa
Parents: ddac2b6
Author: Tim Van Steenburgh <tv...@gmail.com>
Authored: Wed Aug 28 16:54:52 2013 +0000
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Tue Sep 3 14:46:51 2013 +0000
----------------------------------------------------------------------
ForgeImporters/forgeimporters/templates/importer_base.html | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/e795553b/ForgeImporters/forgeimporters/templates/importer_base.html
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/templates/importer_base.html b/ForgeImporters/forgeimporters/templates/importer_base.html
index 7a25543..b97eedf 100644
--- a/ForgeImporters/forgeimporters/templates/importer_base.html
+++ b/ForgeImporters/forgeimporters/templates/importer_base.html
@@ -64,6 +64,7 @@
<form action="create" method="post" enctype="multipart/form-data">
{% block importer_fields %}
{% endblock %}
+ {% if not show_mount_fields is defined or show_mount_fields %}
<div>
<label for="mount_label">Label</label>
<input name="mount_label" value="{{ c.form_values['mount_label'] or target_app.default_mount_label }}" />
@@ -74,7 +75,7 @@
<input name="mount_point" value="{{ c.form_values['mount_point'] or target_app.default_mount_point }}" />
{{ error('mount_point') }}
</div>
-
+ {% endif %}
<input type="submit" value="Import"/>
</form>
{% endblock %}
[22/29] git commit: [#6541] Added import_id and AuditLog to GC repo
importer
Posted by tv...@apache.org.
[#6541] Added import_id and AuditLog to GC repo importer
Signed-off-by: Cory Johns <cj...@slashdotmedia.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/59a395df
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/59a395df
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/59a395df
Branch: refs/heads/db/6640
Commit: 59a395dfcccf6829162fb2c9ff2f4c02737c97ff
Parents: 4a4ee8f
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Wed Aug 28 20:42:33 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Mon Sep 9 20:27:30 2013 +0000
----------------------------------------------------------------------
ForgeImporters/forgeimporters/google/code.py | 12 +++++++++++-
.../forgeimporters/google/tests/test_code.py | 18 ++++++++++++++----
2 files changed, 25 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/59a395df/ForgeImporters/forgeimporters/google/code.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/google/code.py b/ForgeImporters/forgeimporters/google/code.py
index 4cf752d..c5f34cd 100644
--- a/ForgeImporters/forgeimporters/google/code.py
+++ b/ForgeImporters/forgeimporters/google/code.py
@@ -36,6 +36,7 @@ from tg.decorators import (
from allura.controllers import BaseController
from allura.lib import validators as v
from allura.lib.decorators import require_post, task
+from allura import model as M
from forgeimporters.base import (
ToolImporter,
@@ -168,6 +169,15 @@ class GoogleRepoImporter(ToolImporter):
mount_point=mount_point or 'code',
mount_label=mount_label or 'Code',
init_from_url=repo_url,
- )
+ import_id={
+ 'source': self.source,
+ 'project_name': project_name,
+ }
+ )
+ M.AuditLog.log(
+ 'import tool %s from %s on %s' % (
+ app.config.options.mount_point,
+ project_name, self.source,
+ ), project=project, user=user)
g.post_event('project_updated')
return app
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/59a395df/ForgeImporters/forgeimporters/google/tests/test_code.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/google/tests/test_code.py b/ForgeImporters/forgeimporters/google/tests/test_code.py
index c6874ad..4028076 100644
--- a/ForgeImporters/forgeimporters/google/tests/test_code.py
+++ b/ForgeImporters/forgeimporters/google/tests/test_code.py
@@ -57,20 +57,30 @@ class TestGoogleRepoImporter(TestCase):
return project
@patch('forgeimporters.google.code.g')
+ @patch('forgeimporters.google.code.M')
@patch('forgeimporters.google.code.GoogleCodeProjectExtractor')
@patch('forgeimporters.google.code.get_repo_url')
- def test_import_tool_happy_path(self, get_repo_url, gcpe, g):
+ def test_import_tool_happy_path(self, get_repo_url, gcpe, M, g):
gcpe.return_value.get_repo_type.return_value = 'git'
get_repo_url.return_value = 'http://remote/clone/url/'
p = self._make_project(gc_proj_name='myproject')
- GoogleRepoImporter().import_tool(p, Mock(name='c.user'),
- project_name='project_name')
+ u = Mock(name='c.user')
+ app = p.install_app.return_value
+ app.config.options.mount_point = 'code'
+ GoogleRepoImporter().import_tool(p, u, project_name='project_name')
get_repo_url.assert_called_once_with('project_name', 'git')
p.install_app.assert_called_once_with('Git',
mount_point='code',
mount_label='Code',
init_from_url='http://remote/clone/url/',
- )
+ import_id={
+ 'source': 'Google Code',
+ 'project_name': 'project_name',
+ },
+ )
+ M.AuditLog.log.assert_called_once_with(
+ 'import tool code from project_name on Google Code',
+ project=p, user=u)
g.post_event.assert_called_once_with('project_updated')
[13/29] git commit: [#5775] ticket:404 fixed log implementation error
Posted by tv...@apache.org.
[#5775] ticket:404 fixed log implementation error
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/9a5ec88c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/9a5ec88c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/9a5ec88c
Branch: refs/heads/tv/6457
Commit: 9a5ec88c577d05b1cecd40a58e4fb4ce21e9f104
Parents: 2409375
Author: Anton Kasyanov <mi...@gmail.com>
Authored: Tue Aug 6 17:26:42 2013 +0300
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Thu Aug 29 19:00:45 2013 +0000
----------------------------------------------------------------------
Allura/allura/templates/widgets/repo/log.html | 6 +--
ForgeGit/forgegit/model/git_repo.py | 52 ++++++++++++++------
.../forgegit/tests/model/test_repository.py | 16 +++---
3 files changed, 48 insertions(+), 26 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/9a5ec88c/Allura/allura/templates/widgets/repo/log.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/widgets/repo/log.html b/Allura/allura/templates/widgets/repo/log.html
index c3ced6f..ec6b048 100644
--- a/Allura/allura/templates/widgets/repo/log.html
+++ b/Allura/allura/templates/widgets/repo/log.html
@@ -54,11 +54,11 @@
pushed by {{ user_link(commit.committed.email, commit.committed.name) }}
{% endif %}
{{g.markdown.convert(commit.message)}}
- {% if commit.renamed_from %}
+ {% if commit.rename_details %}
<div>
<b>renamed from</b>
- <a href={{commit.renamed_from['commit_url']}}log/?path={{ commit.renamed_from['path'] }}>
- {{ commit.renamed_from['path'] }}
+ <a href={{commit.rename_details['commit_url']}}log/?path={{ commit.rename_details['path'] }}>
+ {{ commit.rename_details['path'] }}
</a>
</div>
{% endif %}
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/9a5ec88c/ForgeGit/forgegit/model/git_repo.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/model/git_repo.py b/ForgeGit/forgegit/model/git_repo.py
index 1599fd2..7262efa 100644
--- a/ForgeGit/forgegit/model/git_repo.py
+++ b/ForgeGit/forgegit/model/git_repo.py
@@ -338,7 +338,7 @@ class GitImplementation(M.RepositoryImplementation):
'refs': refs,
'parents': [pci.hexsha for pci in ci.parents],
'size': size,
- 'renamed_from': rename_details,
+ 'rename_details': rename_details,
}
if rename_details:
# we do not need to show commits before rename
@@ -362,24 +362,46 @@ class GitImplementation(M.RepositoryImplementation):
of lazy-loading the commit data is probably fine. But if this
ends up being a bottleneck, that would be one possibile
optimization.
+
+ Renaming
+ Detection of renaming can be implemented using diff with parent
+ with create_path=True. But taking diffs is slow. That's why
+ --name-status is added to log.
+ Then log returns something like this:
+ <commit hash>x00 <refs>
+ \n # empty line
+ R100 <renamed from path> <renamed to path> # when rename happens
+ A\t<some path> # other cases
+ D\t<some path> # other cases
+ etc
"""
proc = self._git.git.log(*args, format='%H%x00%d', as_process=True, **kwargs)
stream = proc.stdout
+ commit_lines = []
while True:
- commit_lines = [stream.readline() for _ in xrange(3)]
- commit_line = '\x00'.join(
- [line.strip('\n ').replace('\t', ' ') for line in commit_lines if line.strip('\n\t ')]
- )
- if not commit_line:
- break
- hexsha, decoration, name_stat = commit_line.strip().split('\x00')
- refs = decoration.strip(' ()').split(', ') if decoration else []
- name_stat_parts = name_stat.split(' ')
- renamed = {}
- if name_stat_parts[0] == 'R100':
- renamed['from'] = name_stat_parts[1]
- renamed['to'] = name_stat_parts[2]
- yield (git.Commit(self._git, gitdb.util.hex_to_bin(hexsha)), refs, renamed)
+ line = stream.readline()
+ if '\x00' in line or not(len(line)):
+ # hash line read, need to yield previous commit
+ # first, cleaning lines a bit
+ commit_lines = [
+ ln.strip('\n\ ').replace('\t', ' ')
+ for ln in commit_lines if ln.strip('\n ')
+ ]
+ if commit_lines:
+ hexsha, decoration = commit_lines[0].split('\x00')
+ refs = decoration.strip(' ()').split(', ') if decoration else []
+ name_stat_parts = commit_lines[1].split(' ')
+ renamed = {}
+ if name_stat_parts[0] == 'R100':
+ renamed['from'] = name_stat_parts[1]
+ renamed['to'] = name_stat_parts[2]
+ yield (git.Commit(self._git, gitdb.util.hex_to_bin(hexsha)), refs, renamed)
+ if not(len(line)):
+ # if all lines have been read
+ break
+ commit_lines = [line]
+ else:
+ commit_lines.append(line)
def open_blob(self, blob):
return _OpenedGitBlob(
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/9a5ec88c/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 d116a10..e55fed7 100644
--- a/ForgeGit/forgegit/tests/model/test_repository.py
+++ b/ForgeGit/forgegit/tests/model/test_repository.py
@@ -241,7 +241,7 @@ class TestGitRepo(unittest.TestCase, RepoImplTestBase):
'parents': ['df30427c488aeab84b2352bdf88a3b19223f9d7a'],
'refs': ['HEAD', 'foo', 'master'],
'size': None,
- 'renamed_from': {}},
+ 'rename_details': {}},
{'authored': {'date': datetime.datetime(2010, 10, 7, 18, 44, 1),
'email': u'rcopeland@geek.net',
'name': u'Rick Copeland'},
@@ -253,7 +253,7 @@ class TestGitRepo(unittest.TestCase, RepoImplTestBase):
'parents': ['6a45885ae7347f1cac5103b0050cc1be6a1496c8'],
'refs': [],
'size': None,
- 'renamed_from': {}},
+ 'rename_details': {}},
{'authored': {'date': datetime.datetime(2010, 10, 7, 18, 43, 26),
'email': u'rcopeland@geek.net',
'name': u'Rick Copeland'},
@@ -265,7 +265,7 @@ class TestGitRepo(unittest.TestCase, RepoImplTestBase):
'parents': ['9a7df788cf800241e3bb5a849c8870f2f8259d98'],
'refs': [],
'size': None,
- 'renamed_from': {}},
+ 'rename_details': {}},
{'authored': {'date': datetime.datetime(2010, 10, 7, 18, 42, 54),
'email': u'rcopeland@geek.net',
'name': u'Rick Copeland'},
@@ -277,7 +277,7 @@ class TestGitRepo(unittest.TestCase, RepoImplTestBase):
'parents': [],
'refs': [],
'size': None,
- 'renamed_from': {}},
+ 'rename_details': {}},
])
def test_log_file(self):
@@ -294,7 +294,7 @@ class TestGitRepo(unittest.TestCase, RepoImplTestBase):
'parents': ['df30427c488aeab84b2352bdf88a3b19223f9d7a'],
'refs': ['HEAD', 'foo', 'master'],
'size': 28,
- 'renamed_from': {}},
+ 'rename_details': {}},
{'authored': {'date': datetime.datetime(2010, 10, 7, 18, 44, 1),
'email': u'rcopeland@geek.net',
'name': u'Rick Copeland'},
@@ -306,7 +306,7 @@ class TestGitRepo(unittest.TestCase, RepoImplTestBase):
'parents': ['6a45885ae7347f1cac5103b0050cc1be6a1496c8'],
'refs': [],
'size': 15,
- 'renamed_from': {}},
+ 'rename_details': {}},
])
def test_commit(self):
@@ -570,8 +570,8 @@ class TestGitRename(unittest.TestCase):
commits = list(self.repo.log(id_only=False, path='/f2.txt'))
self.assertEqual(len(commits), 2)
rename_commit = commits[1]
- self.assertEqual(rename_commit['renamed_from']['path'], '/f.txt')
+ self.assertEqual(rename_commit['rename_details']['path'], '/f.txt')
self.assertEqual(
- rename_commit['renamed_from']['commit_url'],
+ rename_commit['rename_details']['commit_url'],
self.repo.url_for_commit(rename_commit['id'])
)
[15/29] git commit: [#5775] Bump ForgeHg version
Posted by tv...@apache.org.
[#5775] Bump ForgeHg version
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/ddac2b66
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/ddac2b66
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/ddac2b66
Branch: refs/heads/tv/6457
Commit: ddac2b664d38f3c772d52e860be60d5cdd17968e
Parents: d509748
Author: Tim Van Steenburgh <tv...@gmail.com>
Authored: Thu Aug 29 19:18:43 2013 +0000
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Thu Aug 29 19:18:43 2013 +0000
----------------------------------------------------------------------
requirements-sf.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/ddac2b66/requirements-sf.txt
----------------------------------------------------------------------
diff --git a/requirements-sf.txt b/requirements-sf.txt
index 4e00d83..6115291 100644
--- a/requirements-sf.txt
+++ b/requirements-sf.txt
@@ -4,7 +4,7 @@ akismet==0.2.0
amqplib==0.6.1
kombu==1.0.4
coverage==3.5a1-20110413
-ForgeHg==0.1.15
+ForgeHg==0.1.16
ForgePastebin==0.2.7
GoogleCodeWikiImporter==0.3.0
mechanize==0.2.4
[08/29] git commit: [5775] ticket:401 added tests for renaming
Posted by tv...@apache.org.
[5775] ticket:401 added tests for renaming
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/cee60059
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/cee60059
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/cee60059
Branch: refs/heads/tv/6457
Commit: cee60059cbd356722eb06f1742bdf60a0f2cadca
Parents: 385611c
Author: Anton Kasyanov <mi...@gmail.com>
Authored: Thu Aug 1 17:42:51 2013 +0300
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Thu Aug 29 19:00:44 2013 +0000
----------------------------------------------------------------------
Allura/allura/templates/widgets/repo/log.html | 2 +-
ForgeGit/forgegit/model/git_repo.py | 1 -
.../data/testrename.git/.SOURCEFORGE-REPOSITORY | 1 +
.../forgegit/tests/data/testrename.git/HEAD | 1 +
.../forgegit/tests/data/testrename.git/config | 7 +
.../tests/data/testrename.git/description | 1 +
.../testrename.git/hooks/applypatch-msg.sample | 15 ++
.../data/testrename.git/hooks/commit-msg.sample | 24 +++
.../data/testrename.git/hooks/post-receive | 9 +
.../testrename.git/hooks/post-update.sample | 8 +
.../testrename.git/hooks/pre-applypatch.sample | 14 ++
.../data/testrename.git/hooks/pre-commit.sample | 50 ++++++
.../data/testrename.git/hooks/pre-rebase.sample | 169 +++++++++++++++++++
.../hooks/prepare-commit-msg.sample | 36 ++++
.../data/testrename.git/hooks/update.sample | 128 ++++++++++++++
.../tests/data/testrename.git/info/exclude | 6 +
.../25/9c77dd6ee0e6091d11e429b56c44ccbf1e64a3 | 2 +
.../25/ac990c253975ab297e9955825e4ef9dc515d82 | Bin 0 -> 35 bytes
.../72/68e74cd78a7c34f1a4a6dfb6ce861e35f571d4 | Bin 0 -> 43 bytes
.../7b/57bd29ea8afbdeb9bac64cf7074f4b531492a8 | Bin 0 -> 26 bytes
.../7c/09182e61af959e4f1fb0e354bab49f14ef810d | Bin 0 -> 133 bytes
.../89/b97e3324e20b57543ae48ced731e31a052548c | Bin 0 -> 49 bytes
.../9a/cb8ca3e5703fa90f1cdc708dd070c17d0c26d8 | Bin 0 -> 50 bytes
.../b1/20505a61225e6c14bee3e5b5862db81628c35c | Bin 0 -> 160 bytes
.../c5/5a64046f8618a4c84c74dc834eb5722dabd58a | Bin 0 -> 51 bytes
.../dd/633a6dd42e52a66b277324fb75d83295d20f98 | Bin 0 -> 50 bytes
.../fb/b0644603bb6ecee3ebb62efe8c86efc9b84ee6 | Bin 0 -> 168 bytes
.../tests/data/testrename.git/refs/heads/master | 1 +
.../tests/functional/test_controllers.py | 24 +++
.../forgegit/tests/model/test_repository.py | 35 ++++
30 files changed, 532 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/cee60059/Allura/allura/templates/widgets/repo/log.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/widgets/repo/log.html b/Allura/allura/templates/widgets/repo/log.html
index b54685f..c3ced6f 100644
--- a/Allura/allura/templates/widgets/repo/log.html
+++ b/Allura/allura/templates/widgets/repo/log.html
@@ -56,7 +56,7 @@
{{g.markdown.convert(commit.message)}}
{% if commit.renamed_from %}
<div>
- <b>renamed from</b> 
+ <b>renamed from</b>
<a href={{commit.renamed_from['commit_url']}}log/?path={{ commit.renamed_from['path'] }}>
{{ commit.renamed_from['path'] }}
</a>
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/cee60059/ForgeGit/forgegit/model/git_repo.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/model/git_repo.py b/ForgeGit/forgegit/model/git_repo.py
index cee505f..fc7be67 100644
--- a/ForgeGit/forgegit/model/git_repo.py
+++ b/ForgeGit/forgegit/model/git_repo.py
@@ -335,7 +335,6 @@ class GitImplementation(M.RepositoryImplementation):
os.path.dirname(path),
deleted_diff.b_blob.name,
)
- renamed_from['commit_id'] = ci.hexsha
renamed_from['commit_url'] = self._repo.url_for_commit(
ci.hexsha
)
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/cee60059/ForgeGit/forgegit/tests/data/testrename.git/.SOURCEFORGE-REPOSITORY
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testrename.git/.SOURCEFORGE-REPOSITORY b/ForgeGit/forgegit/tests/data/testrename.git/.SOURCEFORGE-REPOSITORY
new file mode 100644
index 0000000..0899c29
--- /dev/null
+++ b/ForgeGit/forgegit/tests/data/testrename.git/.SOURCEFORGE-REPOSITORY
@@ -0,0 +1 @@
+git
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/cee60059/ForgeGit/forgegit/tests/data/testrename.git/HEAD
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testrename.git/HEAD b/ForgeGit/forgegit/tests/data/testrename.git/HEAD
new file mode 100644
index 0000000..cb089cd
--- /dev/null
+++ b/ForgeGit/forgegit/tests/data/testrename.git/HEAD
@@ -0,0 +1 @@
+ref: refs/heads/master
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/cee60059/ForgeGit/forgegit/tests/data/testrename.git/config
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testrename.git/config b/ForgeGit/forgegit/tests/data/testrename.git/config
new file mode 100644
index 0000000..164a3ce
--- /dev/null
+++ b/ForgeGit/forgegit/tests/data/testrename.git/config
@@ -0,0 +1,7 @@
+[core]
+ repositoryformatversion = 0
+ filemode = true
+ bare = true
+ sharedrepository = 2
+[receive]
+ denyNonFastforwards = true
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/cee60059/ForgeGit/forgegit/tests/data/testrename.git/description
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testrename.git/description b/ForgeGit/forgegit/tests/data/testrename.git/description
new file mode 100644
index 0000000..498b267
--- /dev/null
+++ b/ForgeGit/forgegit/tests/data/testrename.git/description
@@ -0,0 +1 @@
+Unnamed repository; edit this file 'description' to name the repository.
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/cee60059/ForgeGit/forgegit/tests/data/testrename.git/hooks/applypatch-msg.sample
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testrename.git/hooks/applypatch-msg.sample b/ForgeGit/forgegit/tests/data/testrename.git/hooks/applypatch-msg.sample
new file mode 100755
index 0000000..8b2a2fe
--- /dev/null
+++ b/ForgeGit/forgegit/tests/data/testrename.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/incubator-allura/blob/cee60059/ForgeGit/forgegit/tests/data/testrename.git/hooks/commit-msg.sample
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testrename.git/hooks/commit-msg.sample b/ForgeGit/forgegit/tests/data/testrename.git/hooks/commit-msg.sample
new file mode 100755
index 0000000..b58d118
--- /dev/null
+++ b/ForgeGit/forgegit/tests/data/testrename.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/incubator-allura/blob/cee60059/ForgeGit/forgegit/tests/data/testrename.git/hooks/post-receive
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testrename.git/hooks/post-receive b/ForgeGit/forgegit/tests/data/testrename.git/hooks/post-receive
new file mode 100755
index 0000000..3ab92f5
--- /dev/null
+++ b/ForgeGit/forgegit/tests/data/testrename.git/hooks/post-receive
@@ -0,0 +1,9 @@
+#!/bin/bash
+# The following is required for site integration, do not remove/modify.
+# Place user hook code in post-receive-user and it will be called from here.
+curl -s http://localhost:8080/auth/refresh_repo/p/test2/code/
+
+DIR="$(dirname "${BASH_SOURCE[0]}")"
+if [ -x $DIR/post-receive-user ]; then
+ exec $DIR/post-receive-user
+fi
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/cee60059/ForgeGit/forgegit/tests/data/testrename.git/hooks/post-update.sample
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testrename.git/hooks/post-update.sample b/ForgeGit/forgegit/tests/data/testrename.git/hooks/post-update.sample
new file mode 100755
index 0000000..ec17ec1
--- /dev/null
+++ b/ForgeGit/forgegit/tests/data/testrename.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/incubator-allura/blob/cee60059/ForgeGit/forgegit/tests/data/testrename.git/hooks/pre-applypatch.sample
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testrename.git/hooks/pre-applypatch.sample b/ForgeGit/forgegit/tests/data/testrename.git/hooks/pre-applypatch.sample
new file mode 100755
index 0000000..b1f187c
--- /dev/null
+++ b/ForgeGit/forgegit/tests/data/testrename.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/incubator-allura/blob/cee60059/ForgeGit/forgegit/tests/data/testrename.git/hooks/pre-commit.sample
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testrename.git/hooks/pre-commit.sample b/ForgeGit/forgegit/tests/data/testrename.git/hooks/pre-commit.sample
new file mode 100755
index 0000000..18c4829
--- /dev/null
+++ b/ForgeGit/forgegit/tests/data/testrename.git/hooks/pre-commit.sample
@@ -0,0 +1,50 @@
+#!/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 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
+ echo "Error: Attempt to add a non-ascii file name."
+ echo
+ echo "This can cause problems if you want to work"
+ echo "with people on other platforms."
+ echo
+ echo "To be portable it is advisable to rename the file ..."
+ echo
+ echo "If you know what you are doing you can disable this"
+ echo "check using:"
+ echo
+ echo " git config hooks.allownonascii true"
+ echo
+ 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/incubator-allura/blob/cee60059/ForgeGit/forgegit/tests/data/testrename.git/hooks/pre-rebase.sample
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testrename.git/hooks/pre-rebase.sample b/ForgeGit/forgegit/tests/data/testrename.git/hooks/pre-rebase.sample
new file mode 100755
index 0000000..33730ca
--- /dev/null
+++ b/ForgeGit/forgegit/tests/data/testrename.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/incubator-allura/blob/cee60059/ForgeGit/forgegit/tests/data/testrename.git/hooks/prepare-commit-msg.sample
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testrename.git/hooks/prepare-commit-msg.sample b/ForgeGit/forgegit/tests/data/testrename.git/hooks/prepare-commit-msg.sample
new file mode 100755
index 0000000..f093a02
--- /dev/null
+++ b/ForgeGit/forgegit/tests/data/testrename.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/incubator-allura/blob/cee60059/ForgeGit/forgegit/tests/data/testrename.git/hooks/update.sample
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testrename.git/hooks/update.sample b/ForgeGit/forgegit/tests/data/testrename.git/hooks/update.sample
new file mode 100755
index 0000000..71ab04e
--- /dev/null
+++ b/ForgeGit/forgegit/tests/data/testrename.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/incubator-allura/blob/cee60059/ForgeGit/forgegit/tests/data/testrename.git/info/exclude
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testrename.git/info/exclude b/ForgeGit/forgegit/tests/data/testrename.git/info/exclude
new file mode 100644
index 0000000..a5196d1
--- /dev/null
+++ b/ForgeGit/forgegit/tests/data/testrename.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/incubator-allura/blob/cee60059/ForgeGit/forgegit/tests/data/testrename.git/objects/25/9c77dd6ee0e6091d11e429b56c44ccbf1e64a3
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testrename.git/objects/25/9c77dd6ee0e6091d11e429b56c44ccbf1e64a3 b/ForgeGit/forgegit/tests/data/testrename.git/objects/25/9c77dd6ee0e6091d11e429b56c44ccbf1e64a3
new file mode 100644
index 0000000..c2ab918
--- /dev/null
+++ b/ForgeGit/forgegit/tests/data/testrename.git/objects/25/9c77dd6ee0e6091d11e429b56c44ccbf1e64a3
@@ -0,0 +1,2 @@
+x��Kj1��)z���
&�k���j�,)�(���:C����I�u��Ʈ
+��)ژ�q���"�f\�/��޵
��[��qÞ£&q1�Ō�|��' (�ǣ�pm�7���Ç��R�V\�c���Vޞ�����`H�X���Z3��sR�.�C���ඪy|2K�
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/cee60059/ForgeGit/forgegit/tests/data/testrename.git/objects/25/ac990c253975ab297e9955825e4ef9dc515d82
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testrename.git/objects/25/ac990c253975ab297e9955825e4ef9dc515d82 b/ForgeGit/forgegit/tests/data/testrename.git/objects/25/ac990c253975ab297e9955825e4ef9dc515d82
new file mode 100644
index 0000000..3fabb2c
Binary files /dev/null and b/ForgeGit/forgegit/tests/data/testrename.git/objects/25/ac990c253975ab297e9955825e4ef9dc515d82 differ
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/cee60059/ForgeGit/forgegit/tests/data/testrename.git/objects/72/68e74cd78a7c34f1a4a6dfb6ce861e35f571d4
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testrename.git/objects/72/68e74cd78a7c34f1a4a6dfb6ce861e35f571d4 b/ForgeGit/forgegit/tests/data/testrename.git/objects/72/68e74cd78a7c34f1a4a6dfb6ce861e35f571d4
new file mode 100644
index 0000000..d7cc85e
Binary files /dev/null and b/ForgeGit/forgegit/tests/data/testrename.git/objects/72/68e74cd78a7c34f1a4a6dfb6ce861e35f571d4 differ
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/cee60059/ForgeGit/forgegit/tests/data/testrename.git/objects/7b/57bd29ea8afbdeb9bac64cf7074f4b531492a8
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testrename.git/objects/7b/57bd29ea8afbdeb9bac64cf7074f4b531492a8 b/ForgeGit/forgegit/tests/data/testrename.git/objects/7b/57bd29ea8afbdeb9bac64cf7074f4b531492a8
new file mode 100644
index 0000000..71d6c5a
Binary files /dev/null and b/ForgeGit/forgegit/tests/data/testrename.git/objects/7b/57bd29ea8afbdeb9bac64cf7074f4b531492a8 differ
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/cee60059/ForgeGit/forgegit/tests/data/testrename.git/objects/7c/09182e61af959e4f1fb0e354bab49f14ef810d
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testrename.git/objects/7c/09182e61af959e4f1fb0e354bab49f14ef810d b/ForgeGit/forgegit/tests/data/testrename.git/objects/7c/09182e61af959e4f1fb0e354bab49f14ef810d
new file mode 100644
index 0000000..7d51fe9
Binary files /dev/null and b/ForgeGit/forgegit/tests/data/testrename.git/objects/7c/09182e61af959e4f1fb0e354bab49f14ef810d differ
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/cee60059/ForgeGit/forgegit/tests/data/testrename.git/objects/89/b97e3324e20b57543ae48ced731e31a052548c
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testrename.git/objects/89/b97e3324e20b57543ae48ced731e31a052548c b/ForgeGit/forgegit/tests/data/testrename.git/objects/89/b97e3324e20b57543ae48ced731e31a052548c
new file mode 100644
index 0000000..8c65cdd
Binary files /dev/null and b/ForgeGit/forgegit/tests/data/testrename.git/objects/89/b97e3324e20b57543ae48ced731e31a052548c differ
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/cee60059/ForgeGit/forgegit/tests/data/testrename.git/objects/9a/cb8ca3e5703fa90f1cdc708dd070c17d0c26d8
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testrename.git/objects/9a/cb8ca3e5703fa90f1cdc708dd070c17d0c26d8 b/ForgeGit/forgegit/tests/data/testrename.git/objects/9a/cb8ca3e5703fa90f1cdc708dd070c17d0c26d8
new file mode 100644
index 0000000..c2eeea8
Binary files /dev/null and b/ForgeGit/forgegit/tests/data/testrename.git/objects/9a/cb8ca3e5703fa90f1cdc708dd070c17d0c26d8 differ
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/cee60059/ForgeGit/forgegit/tests/data/testrename.git/objects/b1/20505a61225e6c14bee3e5b5862db81628c35c
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testrename.git/objects/b1/20505a61225e6c14bee3e5b5862db81628c35c b/ForgeGit/forgegit/tests/data/testrename.git/objects/b1/20505a61225e6c14bee3e5b5862db81628c35c
new file mode 100644
index 0000000..c1249a0
Binary files /dev/null and b/ForgeGit/forgegit/tests/data/testrename.git/objects/b1/20505a61225e6c14bee3e5b5862db81628c35c differ
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/cee60059/ForgeGit/forgegit/tests/data/testrename.git/objects/c5/5a64046f8618a4c84c74dc834eb5722dabd58a
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testrename.git/objects/c5/5a64046f8618a4c84c74dc834eb5722dabd58a b/ForgeGit/forgegit/tests/data/testrename.git/objects/c5/5a64046f8618a4c84c74dc834eb5722dabd58a
new file mode 100644
index 0000000..5068b35
Binary files /dev/null and b/ForgeGit/forgegit/tests/data/testrename.git/objects/c5/5a64046f8618a4c84c74dc834eb5722dabd58a differ
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/cee60059/ForgeGit/forgegit/tests/data/testrename.git/objects/dd/633a6dd42e52a66b277324fb75d83295d20f98
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testrename.git/objects/dd/633a6dd42e52a66b277324fb75d83295d20f98 b/ForgeGit/forgegit/tests/data/testrename.git/objects/dd/633a6dd42e52a66b277324fb75d83295d20f98
new file mode 100644
index 0000000..297abfc
Binary files /dev/null and b/ForgeGit/forgegit/tests/data/testrename.git/objects/dd/633a6dd42e52a66b277324fb75d83295d20f98 differ
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/cee60059/ForgeGit/forgegit/tests/data/testrename.git/objects/fb/b0644603bb6ecee3ebb62efe8c86efc9b84ee6
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testrename.git/objects/fb/b0644603bb6ecee3ebb62efe8c86efc9b84ee6 b/ForgeGit/forgegit/tests/data/testrename.git/objects/fb/b0644603bb6ecee3ebb62efe8c86efc9b84ee6
new file mode 100644
index 0000000..4eef534
Binary files /dev/null and b/ForgeGit/forgegit/tests/data/testrename.git/objects/fb/b0644603bb6ecee3ebb62efe8c86efc9b84ee6 differ
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/cee60059/ForgeGit/forgegit/tests/data/testrename.git/refs/heads/master
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/data/testrename.git/refs/heads/master b/ForgeGit/forgegit/tests/data/testrename.git/refs/heads/master
new file mode 100644
index 0000000..e83ab53
--- /dev/null
+++ b/ForgeGit/forgegit/tests/data/testrename.git/refs/heads/master
@@ -0,0 +1 @@
+259c77dd6ee0e6091d11e429b56c44ccbf1e64a3
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/cee60059/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 c05ef94..638fd90 100644
--- a/ForgeGit/forgegit/tests/functional/test_controllers.py
+++ b/ForgeGit/forgegit/tests/functional/test_controllers.py
@@ -566,3 +566,27 @@ class TestDiff(TestController):
r = self.app.get('/src-git/ci/d961abbbf10341ee18a668c975842c35cfc0bef2/tree/1.png?diff=2ce83a24e52c21e8d2146b1a04a20717c0bb08d7')
assert 'alt="2ce83a2..."' in r
assert 'alt="d961abb..."' in r
+
+class TestGitRename(TestController):
+
+ def setUp(self):
+ super(TestGitRename, 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.status = 'ready'
+ c.app.repo.name = 'testrename.git'
+ ThreadLocalORMSession.flush_all()
+ h.set_context('test', 'src-git', neighborhood='Projects')
+ c.app.repo.refresh()
+ ThreadLocalORMSession.flush_all()
+
+ def test_log(self):
+ resp = self.app.get('/src-git/ci/259c77dd6ee0e6091d11e429b56c44ccbf1e64a3/log/?path=/f2.txt')
+ assert '<b>renamed from</b>' in resp
+ assert '/f.txt' in resp
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/cee60059/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 7d7f69b..15527f7 100644
--- a/ForgeGit/forgegit/tests/model/test_repository.py
+++ b/ForgeGit/forgegit/tests/model/test_repository.py
@@ -540,3 +540,38 @@ class TestGitHtmlView(unittest.TestCase):
assert b.has_html_view
b = self.rev.tree.get_blob_by_path('test.spec.in')
assert b.has_html_view
+
+
+class TestGitRename(unittest.TestCase):
+
+ def setUp(self):
+ setup_basic_test()
+ self.setup_with_tools()
+
+ @with_git
+ def setup_with_tools(self):
+ setup_global_objects()
+ h.set_context('test', 'src-git', neighborhood='Projects')
+ repo_dir = pkg_resources.resource_filename(
+ 'forgegit', 'tests/data')
+ self.repo = GM.Repository(
+ name='testrename.git',
+ fs_path=repo_dir,
+ url_path='/test/',
+ tool='git',
+ status='creating')
+ self.repo.refresh()
+ self.rev = self.repo.commit('HEAD')
+ ThreadLocalORMSession.flush_all()
+ ThreadLocalORMSession.close_all()
+
+ def test_file_commits(self):
+ # There was a file f.txt, then it was renamed to f2.txt.
+ commits = list(self.repo.log(id_only=False, path='/f2.txt'))
+ self.assertEqual(len(commits), 2)
+ rename_commit = commits[1]
+ self.assertEqual(rename_commit['renamed_from']['path'], '/f.txt')
+ self.assertEqual(
+ rename_commit['renamed_from']['commit_url'],
+ self.repo.url_for_commit(rename_commit['id'])
+ )
\ No newline at end of file
[06/29] git commit: [#5775] ticket:404 fixed typo
Posted by tv...@apache.org.
[#5775] ticket:404 fixed typo
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/a6dccae5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/a6dccae5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/a6dccae5
Branch: refs/heads/tv/6457
Commit: a6dccae59299615a3f7944a3b6cbcd6fe26ecede
Parents: cee6005
Author: Anton Kasyanov <mi...@gmail.com>
Authored: Thu Aug 1 18:12:23 2013 +0300
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Thu Aug 29 19:00:44 2013 +0000
----------------------------------------------------------------------
ForgeGit/forgegit/tests/model/test_repository.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/a6dccae5/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 15527f7..d116a10 100644
--- a/ForgeGit/forgegit/tests/model/test_repository.py
+++ b/ForgeGit/forgegit/tests/model/test_repository.py
@@ -565,7 +565,7 @@ class TestGitRename(unittest.TestCase):
ThreadLocalORMSession.flush_all()
ThreadLocalORMSession.close_all()
- def test_file_commits(self):
+ def test_renamed_file(self):
# There was a file f.txt, then it was renamed to f2.txt.
commits = list(self.repo.log(id_only=False, path='/f2.txt'))
self.assertEqual(len(commits), 2)
@@ -574,4 +574,4 @@ class TestGitRename(unittest.TestCase):
self.assertEqual(
rename_commit['renamed_from']['commit_url'],
self.repo.url_for_commit(rename_commit['id'])
- )
\ No newline at end of file
+ )
[07/29] git commit: [5775] ticket:404 added renaming tracking for
file history in git
Posted by tv...@apache.org.
[5775] ticket:404 added renaming tracking for file history in git
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/dd57c984
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/dd57c984
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/dd57c984
Branch: refs/heads/tv/6457
Commit: dd57c984cdcd581abe665fbb571ad8080839184a
Parents: 839e624
Author: Anton Kasyanov <mi...@gmail.com>
Authored: Thu Aug 1 13:36:45 2013 +0300
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Thu Aug 29 19:00:44 2013 +0000
----------------------------------------------------------------------
Allura/allura/templates/widgets/repo/log.html | 8 +++++
ForgeGit/forgegit/model/git_repo.py | 35 +++++++++++++++++++++-
2 files changed, 42 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/dd57c984/Allura/allura/templates/widgets/repo/log.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/widgets/repo/log.html b/Allura/allura/templates/widgets/repo/log.html
index 69d7129..b54685f 100644
--- a/Allura/allura/templates/widgets/repo/log.html
+++ b/Allura/allura/templates/widgets/repo/log.html
@@ -54,6 +54,14 @@
pushed by {{ user_link(commit.committed.email, commit.committed.name) }}
{% endif %}
{{g.markdown.convert(commit.message)}}
+ {% if commit.renamed_from %}
+ <div>
+ <b>renamed from</b> 
+ <a href={{commit.renamed_from['commit_url']}}log/?path={{ commit.renamed_from['path'] }}>
+ {{ commit.renamed_from['path'] }}
+ </a>
+ </div>
+ {% endif %}
</div>
</td>
<td style="vertical-align: text-top">
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/dd57c984/ForgeGit/forgegit/model/git_repo.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/model/git_repo.py b/ForgeGit/forgegit/model/git_repo.py
index e0e47b8..f400d56 100644
--- a/ForgeGit/forgegit/model/git_repo.py
+++ b/ForgeGit/forgegit/model/git_repo.py
@@ -302,12 +302,40 @@ class GitImplementation(M.RepositoryImplementation):
if exclude is not None:
revs.extend(['^%s' % e for e in exclude])
- for ci, refs in self._iter_commits_with_refs(revs, '--', path):
+ for ci, refs in self._iter_commits_with_refs(revs, '--follow', '--', path):
if id_only:
yield ci.hexsha
else:
size = None
+ renamed_from = {}
if path:
+ # checking for renaming in this commit
+ # log is called with follow, so there should be all commits
+ # even before renaming
+ diffs_with_parent = ci.diff(ci.parents[0])
+ deleted_file_diffs = []
+ renamed = False
+ for diff in diffs_with_parent:
+ if not diff.b_mode and not diff.b_blob:
+ #new file was created
+ if diff.a_blob.name == os.path.basename(path):
+ renamed = True
+ if not diff.a_mode and not diff.a_blob:
+ #file was deleted
+ deleted_file_diffs.append(diff)
+ if renamed:
+ if len(deleted_file_diffs) > 1:
+ log.info('Couldn\'t find if file was renamed: too many deletions')
+ elif len(deleted_file_diffs) == 1:
+ deleted_diff = deleted_file_diffs[0]
+ renamed_from['path'] = '{}/{}'.format(
+ os.path.dirname(path),
+ deleted_diff.b_blob.name,
+ )
+ renamed_from['commit_id'] = ci.hexsha
+ renamed_from['commit_url'] = self._repo.url_for_commit(
+ ci.hexsha
+ )
try:
node = ci.tree/path
size = node.size if node.type == 'blob' else None
@@ -329,7 +357,12 @@ class GitImplementation(M.RepositoryImplementation):
'refs': refs,
'parents': [pci.hexsha for pci in ci.parents],
'size': size,
+ 'renamed_from': renamed_from,
}
+ if renamed_from:
+ # if file was renamed, do not yield commits
+ # before renaming
+ break
def _iter_commits_with_refs(self, *args, **kwargs):
"""
[26/29] git commit: [#6541] Added AuditLog on GC tracker import
Posted by tv...@apache.org.
[#6541] Added AuditLog on GC tracker import
Signed-off-by: Cory Johns <cj...@slashdotmedia.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/ad81824e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/ad81824e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/ad81824e
Branch: refs/heads/db/6640
Commit: ad81824eb88349296e5c5baa810b42923003d8e6
Parents: 4486642
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Wed Aug 28 19:38:10 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Mon Sep 9 20:27:30 2013 +0000
----------------------------------------------------------------------
ForgeImporters/forgeimporters/google/tracker.py | 12 +++++++++---
.../tests/google/functional/test_tracker.py | 1 +
.../forgeimporters/tests/google/test_tracker.py | 13 ++++++++-----
3 files changed, 18 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/ad81824e/ForgeImporters/forgeimporters/google/tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/google/tracker.py b/ForgeImporters/forgeimporters/google/tracker.py
index 58f28d2..cf6067e 100644
--- a/ForgeImporters/forgeimporters/google/tracker.py
+++ b/ForgeImporters/forgeimporters/google/tracker.py
@@ -24,9 +24,6 @@ from pylons import tmpl_context as c
from pylons import app_globals as g
from ming.orm import session, ThreadLocalORMSession
-from allura import model as M
-#import gdata
-gdata = None
from tg import (
expose,
flash,
@@ -42,6 +39,7 @@ from allura.controllers import BaseController
from allura.lib import helpers as h
from allura.lib.plugin import ImportIdConverter
from allura.lib.decorators import require_post, task
+from allura import model as M
from forgetracker.tracker_main import ForgeTrackerApp
from forgetracker import model as TM
@@ -142,6 +140,14 @@ class GoogleCodeTrackerImporter(ToolImporter):
app.globals.custom_fields = self.postprocess_custom_fields()
app.globals.last_ticket_num = self.max_ticket_num
ThreadLocalORMSession.flush_all()
+ M.AuditLog.log(
+ 'import tool %s from %s on %s' % (
+ app.config.options.mount_point,
+ project_name, self.source,
+ ),
+ project=project,
+ user=user,
+ )
g.post_event('project_updated')
app.globals.invalidate_bin_counts()
return app
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/ad81824e/ForgeImporters/forgeimporters/tests/google/functional/test_tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/tests/google/functional/test_tracker.py b/ForgeImporters/forgeimporters/tests/google/functional/test_tracker.py
index 7f504a5..9f48257 100644
--- a/ForgeImporters/forgeimporters/tests/google/functional/test_tracker.py
+++ b/ForgeImporters/forgeimporters/tests/google/functional/test_tracker.py
@@ -50,6 +50,7 @@ class TestGCTrackerImporter(TestCase):
self.assertIsNone(self.project.app_instance('test-issue'))
with mock.patch.object(base.h, 'urlopen') as urlopen,\
mock.patch.object(google.tracker, 'GoogleCodeProjectExtractor') as GPE,\
+ mock.patch.object(google.tracker.M, 'AuditLog') as AL,\
mock.patch('forgetracker.tasks.update_bin_counts') as ubc:
urlopen.side_effect = lambda req, **kw: mock.Mock(read=req.get_full_url, info=lambda:{'content-type': 'text/plain'})
GPE.iter_issues.return_value = [(issue_id, issue)]
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/ad81824e/ForgeImporters/forgeimporters/tests/google/test_tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/tests/google/test_tracker.py b/ForgeImporters/forgeimporters/tests/google/test_tracker.py
index 05b33ae..8f434df 100644
--- a/ForgeImporters/forgeimporters/tests/google/test_tracker.py
+++ b/ForgeImporters/forgeimporters/tests/google/test_tracker.py
@@ -42,12 +42,12 @@ class TestTrackerImporter(TestCase):
importer.postprocess_custom_fields = mock.Mock()
project, user = mock.Mock(), mock.Mock()
app = project.install_app.return_value
- app.config.options = {
- 'import_id': {
- 'source': 'Google Code',
- 'project_name': 'project_name',
- },
+ app.config.options.mount_point = 'mount_point'
+ app.config.options.import_id = {
+ 'source': 'Google Code',
+ 'project_name': 'project_name',
}
+ app.config.options.get = lambda *a: getattr(app.config.options, *a)
issues = gpe.iter_issues.return_value = [(50, mock.Mock()), (100, mock.Mock())]
tickets = TM.Ticket.side_effect = [mock.Mock(), mock.Mock()]
@@ -89,6 +89,9 @@ class TestTrackerImporter(TestCase):
mock.call(tickets[1]),
])
self.assertEqual(app.globals.last_ticket_num, 100)
+ M.AuditLog.log.assert_called_once_with(
+ 'import tool mount_point from project_name on Google Code',
+ project=project, user=user)
g.post_event.assert_called_once_with('project_updated')
app.globals.invalidate_bin_counts.assert_called_once_with()
[23/29] git commit: [#6541] Revert to exact match on import_id and
fix ImportIdConverter docstring
Posted by tv...@apache.org.
[#6541] Revert to exact match on import_id and fix ImportIdConverter docstring
Signed-off-by: Cory Johns <cj...@slashdotmedia.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/44b2a366
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/44b2a366
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/44b2a366
Branch: refs/heads/db/6640
Commit: 44b2a36672d086a9175806a91622edcbe231ae1c
Parents: 59a395d
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Fri Sep 6 17:56:55 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Mon Sep 9 20:27:30 2013 +0000
----------------------------------------------------------------------
Allura/allura/lib/plugin.py | 4 ++--
ForgeTracker/forgetracker/tracker_main.py | 9 ++++-----
2 files changed, 6 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/44b2a366/Allura/allura/lib/plugin.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/plugin.py b/Allura/allura/lib/plugin.py
index 3376034..8e24cb2 100644
--- a/Allura/allura/lib/plugin.py
+++ b/Allura/allura/lib/plugin.py
@@ -955,10 +955,10 @@ class ImportIdConverter(object):
To provide a new converter, expose an entry point in setup.py:
- [allura.tickets.import_id_converter]
+ [allura.import_id_converter]
mysource = foo.bar:SourceIdConverter
- Then in your .ini file, set tickets.import_id_converter=mysource
+ Then in your .ini file, set import_id_converter=mysource
'''
@classmethod
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/44b2a366/ForgeTracker/forgetracker/tracker_main.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tracker_main.py b/ForgeTracker/forgetracker/tracker_main.py
index 3afdb15..61f7a99 100644
--- a/ForgeTracker/forgetracker/tracker_main.py
+++ b/ForgeTracker/forgetracker/tracker_main.py
@@ -1196,11 +1196,10 @@ class TicketController(BaseController, FeedController):
self.ticket = TM.Ticket.query.get(app_config_id=c.app.config._id,
ticket_num=self.ticket_num)
if self.ticket is None:
- query = {'app_config_id': c.app.config._id}
- import_id = ImportIdConverter.get().expand(ticket_num, c.app)
- if import_id:
- query.update({'import_id.%s' % k: v for k,v in import_id.iteritems()})
- self.ticket = TM.Ticket.query.get(**query)
+ self.ticket = TM.Ticket.query.get(
+ app_config_id = c.app.config._id,
+ import_id = ImportIdConverter.get().expand(ticket_num, c.app),
+ )
if self.ticket is not None:
utils.permanent_redirect(self.ticket.url())
else:
[28/29] git commit: [#6640] expose votes_up and votes_down in ticket
API & export
Posted by tv...@apache.org.
[#6640] expose votes_up and votes_down in ticket API & export
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/6e4fe74e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/6e4fe74e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/6e4fe74e
Branch: refs/heads/db/6640
Commit: 6e4fe74ed10b05cfff37a981e7849d0575ec0776
Parents: 815ef4f
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Mon Sep 9 20:22:47 2013 +0000
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Tue Sep 10 12:52:05 2013 +0000
----------------------------------------------------------------------
Allura/allura/model/artifact.py | 6 ++++++
Allura/allura/tests/unit/test_mixins.py | 10 ++++++++++
ForgeTracker/forgetracker/model/ticket.py | 7 ++++++-
ForgeTracker/forgetracker/tests/unit/test_ticket_model.py | 9 ++++++++-
4 files changed, 30 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/6e4fe74e/Allura/allura/model/artifact.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/artifact.py b/Allura/allura/model/artifact.py
index 46c4b01..3910cad 100644
--- a/Allura/allura/model/artifact.py
+++ b/Allura/allura/model/artifact.py
@@ -896,3 +896,9 @@ class VotableArtifact(MappedClass):
if votes_count == 0:
return 0
return int(float(self.votes_up) / votes_count * 100)
+
+ def __json__(self):
+ return {
+ 'votes_up': self.votes_up,
+ 'votes_down': self.votes_down,
+ }
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/6e4fe74e/Allura/allura/tests/unit/test_mixins.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/unit/test_mixins.py b/Allura/allura/tests/unit/test_mixins.py
index a35cbb6..a6c508f 100644
--- a/Allura/allura/tests/unit/test_mixins.py
+++ b/Allura/allura/tests/unit/test_mixins.py
@@ -75,3 +75,13 @@ class TestVotableArtifact(object):
assert vote.votes_down_users == [self.user1.username]
assert vote.votes_up == 0
assert len(vote.votes_up_users) == 0
+
+ def test_json(self):
+ vote = VotableArtifact()
+ assert vote.__json__() == {'votes_up': 0, 'votes_down': 0}
+
+ vote.vote_down(self.user1)
+ assert vote.__json__() == {'votes_up': 0, 'votes_down': 1}
+
+ vote.vote_up(self.user2)
+ assert vote.__json__() == {'votes_up': 1, 'votes_down': 1}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/6e4fe74e/ForgeTracker/forgetracker/model/ticket.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/model/ticket.py b/ForgeTracker/forgetracker/model/ticket.py
index 1d4aeb2..505a991 100644
--- a/ForgeTracker/forgetracker/model/ticket.py
+++ b/ForgeTracker/forgetracker/model/ticket.py
@@ -947,7 +947,12 @@ class Ticket(VersionedArtifact, ActivityObject, VotableArtifact):
return ticket
def __json__(self):
- return dict(super(Ticket,self).__json__(),
+ parents_json = {}
+ for parent in reversed(type(self).mro()):
+ if parent != type(self) and hasattr(parent, '__json__'):
+ parents_json.update(parent.__json__(self))
+
+ return dict(parents_json,
created_date=self.created_date,
ticket_num=self.ticket_num,
summary=self.summary,
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/6e4fe74e/ForgeTracker/forgetracker/tests/unit/test_ticket_model.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tests/unit/test_ticket_model.py b/ForgeTracker/forgetracker/tests/unit/test_ticket_model.py
index 145bc7c..7f7fdd7 100644
--- a/ForgeTracker/forgetracker/tests/unit/test_ticket_model.py
+++ b/ForgeTracker/forgetracker/tests/unit/test_ticket_model.py
@@ -21,7 +21,7 @@ import urllib2
from ming.orm.ormsession import ThreadLocalORMSession
from ming import schema
-from nose.tools import raises, assert_raises, assert_equal
+from nose.tools import raises, assert_raises, assert_equal, assert_in
from forgetracker.model import Ticket, TicketAttachment
from forgetracker.tests.unit import TrackerTestWithModel
@@ -277,3 +277,10 @@ class TestTicketModel(TrackerTestWithModel):
ThreadLocalORMSession.flush_all()
assert_equal(len(ticket.attachments), 1)
assert_equal(ticket.attachments.first().filename, 'test_ticket_model.py')
+
+ def test_json_parents(self):
+ ticket = Ticket.new()
+ json_keys = ticket.__json__().keys()
+ assert_in('related_artifacts', json_keys) # from Artifact
+ assert_in('votes_up', json_keys) # VotableArtifact
+ assert_in('ticket_num', json_keys) # Ticket
[09/29] git commit: [5775] ticket:404 fixed old tests
Posted by tv...@apache.org.
[5775] ticket:404 fixed old tests
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/385611c4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/385611c4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/385611c4
Branch: refs/heads/tv/6457
Commit: 385611c4d50986bfce39cd36d6e1250d0b9df98e
Parents: dd57c98
Author: Anton Kasyanov <mi...@gmail.com>
Authored: Thu Aug 1 14:50:13 2013 +0300
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Thu Aug 29 19:00:44 2013 +0000
----------------------------------------------------------------------
ForgeGit/forgegit/model/git_repo.py | 55 +++++++++++---------
.../forgegit/tests/model/test_repository.py | 18 ++++---
2 files changed, 41 insertions(+), 32 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/385611c4/ForgeGit/forgegit/model/git_repo.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/model/git_repo.py b/ForgeGit/forgegit/model/git_repo.py
index f400d56..cee505f 100644
--- a/ForgeGit/forgegit/model/git_repo.py
+++ b/ForgeGit/forgegit/model/git_repo.py
@@ -301,8 +301,10 @@ class GitImplementation(M.RepositoryImplementation):
path = path.strip('/') if path else None
if exclude is not None:
revs.extend(['^%s' % e for e in exclude])
-
- for ci, refs in self._iter_commits_with_refs(revs, '--follow', '--', path):
+ args = [revs, '--', path]
+ if path:
+ args.append('--follow')
+ for ci, refs in self._iter_commits_with_refs(*args):
if id_only:
yield ci.hexsha
else:
@@ -312,30 +314,31 @@ class GitImplementation(M.RepositoryImplementation):
# checking for renaming in this commit
# log is called with follow, so there should be all commits
# even before renaming
- diffs_with_parent = ci.diff(ci.parents[0])
- deleted_file_diffs = []
- renamed = False
- for diff in diffs_with_parent:
- if not diff.b_mode and not diff.b_blob:
- #new file was created
- if diff.a_blob.name == os.path.basename(path):
- renamed = True
- if not diff.a_mode and not diff.a_blob:
- #file was deleted
- deleted_file_diffs.append(diff)
- if renamed:
- if len(deleted_file_diffs) > 1:
- log.info('Couldn\'t find if file was renamed: too many deletions')
- elif len(deleted_file_diffs) == 1:
- deleted_diff = deleted_file_diffs[0]
- renamed_from['path'] = '{}/{}'.format(
- os.path.dirname(path),
- deleted_diff.b_blob.name,
- )
- renamed_from['commit_id'] = ci.hexsha
- renamed_from['commit_url'] = self._repo.url_for_commit(
- ci.hexsha
- )
+ if ci.parents:
+ diffs_with_parent = ci.diff(ci.parents[0])
+ deleted_file_diffs = []
+ renamed = False
+ for diff in diffs_with_parent:
+ if not diff.b_mode and not diff.b_blob:
+ #new file was created
+ if diff.a_blob.name == os.path.basename(path):
+ renamed = True
+ if not diff.a_mode and not diff.a_blob:
+ #file was deleted
+ deleted_file_diffs.append(diff)
+ if renamed:
+ if len(deleted_file_diffs) > 1:
+ log.info('Couldn\'t find if file was renamed: too many deletions')
+ elif len(deleted_file_diffs) == 1:
+ deleted_diff = deleted_file_diffs[0]
+ renamed_from['path'] = '{}/{}'.format(
+ os.path.dirname(path),
+ deleted_diff.b_blob.name,
+ )
+ renamed_from['commit_id'] = ci.hexsha
+ renamed_from['commit_url'] = self._repo.url_for_commit(
+ ci.hexsha
+ )
try:
node = ci.tree/path
size = node.size if node.type == 'blob' else None
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/385611c4/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 85777e2..7d7f69b 100644
--- a/ForgeGit/forgegit/tests/model/test_repository.py
+++ b/ForgeGit/forgegit/tests/model/test_repository.py
@@ -240,7 +240,8 @@ class TestGitRepo(unittest.TestCase, RepoImplTestBase):
'message': u'Change README\n',
'parents': ['df30427c488aeab84b2352bdf88a3b19223f9d7a'],
'refs': ['HEAD', 'foo', 'master'],
- 'size': None},
+ 'size': None,
+ 'renamed_from': {}},
{'authored': {'date': datetime.datetime(2010, 10, 7, 18, 44, 1),
'email': u'rcopeland@geek.net',
'name': u'Rick Copeland'},
@@ -251,7 +252,8 @@ class TestGitRepo(unittest.TestCase, RepoImplTestBase):
'message': u'Add README\n',
'parents': ['6a45885ae7347f1cac5103b0050cc1be6a1496c8'],
'refs': [],
- 'size': None},
+ 'size': None,
+ 'renamed_from': {}},
{'authored': {'date': datetime.datetime(2010, 10, 7, 18, 43, 26),
'email': u'rcopeland@geek.net',
'name': u'Rick Copeland'},
@@ -262,7 +264,8 @@ class TestGitRepo(unittest.TestCase, RepoImplTestBase):
'message': u'Remove file\n',
'parents': ['9a7df788cf800241e3bb5a849c8870f2f8259d98'],
'refs': [],
- 'size': None},
+ 'size': None,
+ 'renamed_from': {}},
{'authored': {'date': datetime.datetime(2010, 10, 7, 18, 42, 54),
'email': u'rcopeland@geek.net',
'name': u'Rick Copeland'},
@@ -273,7 +276,8 @@ class TestGitRepo(unittest.TestCase, RepoImplTestBase):
'message': u'Initial commit\n',
'parents': [],
'refs': [],
- 'size': None},
+ 'size': None,
+ 'renamed_from': {}},
])
def test_log_file(self):
@@ -289,7 +293,8 @@ class TestGitRepo(unittest.TestCase, RepoImplTestBase):
'message': u'Change README\n',
'parents': ['df30427c488aeab84b2352bdf88a3b19223f9d7a'],
'refs': ['HEAD', 'foo', 'master'],
- 'size': 28},
+ 'size': 28,
+ 'renamed_from': {}},
{'authored': {'date': datetime.datetime(2010, 10, 7, 18, 44, 1),
'email': u'rcopeland@geek.net',
'name': u'Rick Copeland'},
@@ -300,7 +305,8 @@ class TestGitRepo(unittest.TestCase, RepoImplTestBase):
'message': u'Add README\n',
'parents': ['6a45885ae7347f1cac5103b0050cc1be6a1496c8'],
'refs': [],
- 'size': 15},
+ 'size': 15,
+ 'renamed_from': {}},
])
def test_commit(self):
[10/29] git commit: [#5775] ticket:405 added tests for renaming in svn
Posted by tv...@apache.org.
[#5775] ticket:405 added tests for renaming in svn
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/d509748e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/d509748e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/d509748e
Branch: refs/heads/tv/6457
Commit: d509748e8edf0e6e8cf47eef217b150a582c06f3
Parents: de91d9d
Author: Anton Kasyanov <mi...@gmail.com>
Authored: Thu Aug 8 18:05:26 2013 +0300
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Thu Aug 29 19:00:45 2013 +0000
----------------------------------------------------------------------
.../data/testsvn-rename/.SOURCEFORGE-REPOSITORY | 1 +
.../tests/data/testsvn-rename/README.txt | 5 ++
.../tests/data/testsvn-rename/conf/authz | 32 +++++++
.../tests/data/testsvn-rename/conf/passwd | 8 ++
.../data/testsvn-rename/conf/svnserve.conf | 47 ++++++++++
.../tests/data/testsvn-rename/db/current | 1 +
.../tests/data/testsvn-rename/db/format | 2 +
.../tests/data/testsvn-rename/db/fs-type | 1 +
.../tests/data/testsvn-rename/db/fsfs.conf | 37 ++++++++
.../data/testsvn-rename/db/min-unpacked-rev | 1 +
.../tests/data/testsvn-rename/db/revprops/0/0 | 5 ++
.../tests/data/testsvn-rename/db/revprops/0/1 | 13 +++
.../tests/data/testsvn-rename/db/revprops/0/2 | 13 +++
.../tests/data/testsvn-rename/db/revprops/0/3 | 13 +++
.../tests/data/testsvn-rename/db/revs/0/0 | 11 +++
.../tests/data/testsvn-rename/db/revs/0/1 | 49 +++++++++++
.../tests/data/testsvn-rename/db/revs/0/2 | Bin 0 -> 716 bytes
.../tests/data/testsvn-rename/db/revs/0/3 | 56 ++++++++++++
.../tests/data/testsvn-rename/db/txn-current | 1 +
.../data/testsvn-rename/db/txn-current-lock | 0
.../forgesvn/tests/data/testsvn-rename/db/uuid | 1 +
.../tests/data/testsvn-rename/db/write-lock | 0
.../forgesvn/tests/data/testsvn-rename/format | 1 +
.../tests/data/testsvn-rename/hooks/post-commit | 8 ++
.../data/testsvn-rename/hooks/post-commit.tmpl | 50 +++++++++++
.../data/testsvn-rename/hooks/post-lock.tmpl | 45 ++++++++++
.../hooks/post-revprop-change.tmpl | 57 +++++++++++++
.../data/testsvn-rename/hooks/post-unlock.tmpl | 43 ++++++++++
.../data/testsvn-rename/hooks/pre-commit.tmpl | 85 +++++++++++++++++++
.../data/testsvn-rename/hooks/pre-lock.tmpl | 71 ++++++++++++++++
.../hooks/pre-revprop-change.tmpl | 66 ++++++++++++++
.../data/testsvn-rename/hooks/pre-unlock.tmpl | 63 ++++++++++++++
.../data/testsvn-rename/hooks/start-commit.tmpl | 68 +++++++++++++++
.../data/testsvn-rename/locks/db-logs.lock | 3 +
.../tests/data/testsvn-rename/locks/db.lock | 3 +
.../tests/functional/test_controllers.py | 27 ++++++
.../forgesvn/tests/model/test_repository.py | 56 ++++++++++--
37 files changed, 935 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d509748e/ForgeSVN/forgesvn/tests/data/testsvn-rename/.SOURCEFORGE-REPOSITORY
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/data/testsvn-rename/.SOURCEFORGE-REPOSITORY b/ForgeSVN/forgesvn/tests/data/testsvn-rename/.SOURCEFORGE-REPOSITORY
new file mode 100644
index 0000000..f2990b4
--- /dev/null
+++ b/ForgeSVN/forgesvn/tests/data/testsvn-rename/.SOURCEFORGE-REPOSITORY
@@ -0,0 +1 @@
+svn
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d509748e/ForgeSVN/forgesvn/tests/data/testsvn-rename/README.txt
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/data/testsvn-rename/README.txt b/ForgeSVN/forgesvn/tests/data/testsvn-rename/README.txt
new file mode 100644
index 0000000..3bf5a57
--- /dev/null
+++ b/ForgeSVN/forgesvn/tests/data/testsvn-rename/README.txt
@@ -0,0 +1,5 @@
+This is a Subversion repository; use the 'svnadmin' tool to examine
+it. Do not add, delete, or modify files here unless you know how
+to avoid corrupting the repository.
+
+Visit http://subversion.tigris.org/ for more information.
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d509748e/ForgeSVN/forgesvn/tests/data/testsvn-rename/conf/authz
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/data/testsvn-rename/conf/authz b/ForgeSVN/forgesvn/tests/data/testsvn-rename/conf/authz
new file mode 100644
index 0000000..0b9a410
--- /dev/null
+++ b/ForgeSVN/forgesvn/tests/data/testsvn-rename/conf/authz
@@ -0,0 +1,32 @@
+### This file is an example authorization file for svnserve.
+### Its format is identical to that of mod_authz_svn authorization
+### files.
+### As shown below each section defines authorizations for the path and
+### (optional) repository specified by the section name.
+### The authorizations follow. An authorization line can refer to:
+### - a single user,
+### - a group of users defined in a special [groups] section,
+### - an alias defined in a special [aliases] section,
+### - all authenticated users, using the '$authenticated' token,
+### - only anonymous users, using the '$anonymous' token,
+### - anyone, using the '*' wildcard.
+###
+### A match can be inverted by prefixing the rule with '~'. Rules can
+### grant read ('r') access, read-write ('rw') access, or no access
+### ('').
+
+[aliases]
+# joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average
+
+[groups]
+# harry_and_sally = harry,sally
+# harry_sally_and_joe = harry,sally,&joe
+
+# [/foo/bar]
+# harry = rw
+# &joe = r
+# * =
+
+# [repository:/baz/fuz]
+# @harry_and_sally = rw
+# * = r
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d509748e/ForgeSVN/forgesvn/tests/data/testsvn-rename/conf/passwd
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/data/testsvn-rename/conf/passwd b/ForgeSVN/forgesvn/tests/data/testsvn-rename/conf/passwd
new file mode 100644
index 0000000..ecaa08d
--- /dev/null
+++ b/ForgeSVN/forgesvn/tests/data/testsvn-rename/conf/passwd
@@ -0,0 +1,8 @@
+### This file is an example password file for svnserve.
+### Its format is similar to that of svnserve.conf. As shown in the
+### example below it contains one section labelled [users].
+### The name and password for each user follow, one account per line.
+
+[users]
+# harry = harryssecret
+# sally = sallyssecret
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d509748e/ForgeSVN/forgesvn/tests/data/testsvn-rename/conf/svnserve.conf
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/data/testsvn-rename/conf/svnserve.conf b/ForgeSVN/forgesvn/tests/data/testsvn-rename/conf/svnserve.conf
new file mode 100644
index 0000000..e62a01e
--- /dev/null
+++ b/ForgeSVN/forgesvn/tests/data/testsvn-rename/conf/svnserve.conf
@@ -0,0 +1,47 @@
+### This file controls the configuration of the svnserve daemon, if you
+### use it to allow access to this repository. (If you only allow
+### access through http: and/or file: URLs, then this file is
+### irrelevant.)
+
+### Visit http://subversion.tigris.org/ for more information.
+
+[general]
+### These options control access to the repository for unauthenticated
+### and authenticated users. Valid values are "write", "read",
+### and "none". The sample settings below are the defaults.
+# anon-access = read
+# auth-access = write
+### The password-db option controls the location of the password
+### database file. Unless you specify a path starting with a /,
+### the file's location is relative to the directory containing
+### this configuration file.
+### If SASL is enabled (see below), this file will NOT be used.
+### Uncomment the line below to use the default password file.
+# password-db = passwd
+### The authz-db option controls the location of the authorization
+### rules for path-based access control. Unless you specify a path
+### starting with a /, the file's location is relative to the the
+### directory containing this file. If you don't specify an
+### authz-db, no path-based access control is done.
+### Uncomment the line below to use the default authorization file.
+# authz-db = authz
+### This option specifies the authentication realm of the repository.
+### If two repositories have the same authentication realm, they should
+### have the same password database, and vice versa. The default realm
+### is repository's uuid.
+# realm = My First Repository
+
+[sasl]
+### This option specifies whether you want to use the Cyrus SASL
+### library for authentication. Default is false.
+### This section will be ignored if svnserve is not built with Cyrus
+### SASL support; to check, run 'svnserve --version' and look for a line
+### reading 'Cyrus SASL authentication is available.'
+# use-sasl = true
+### These options specify the desired strength of the security layer
+### that you want SASL to provide. 0 means no encryption, 1 means
+### integrity-checking only, values larger than 1 are correlated
+### to the effective key length for encryption (e.g. 128 means 128-bit
+### encryption). The values below are the defaults.
+# min-encryption = 0
+# max-encryption = 256
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d509748e/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/current
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/current b/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/current
new file mode 100644
index 0000000..00750ed
--- /dev/null
+++ b/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/current
@@ -0,0 +1 @@
+3
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d509748e/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/format
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/format b/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/format
new file mode 100644
index 0000000..db06890
--- /dev/null
+++ b/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/format
@@ -0,0 +1,2 @@
+4
+layout sharded 1000
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d509748e/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/fs-type
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/fs-type b/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/fs-type
new file mode 100644
index 0000000..4fdd953
--- /dev/null
+++ b/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/fs-type
@@ -0,0 +1 @@
+fsfs
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d509748e/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/fsfs.conf
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/fsfs.conf b/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/fsfs.conf
new file mode 100644
index 0000000..0a5f1fe
--- /dev/null
+++ b/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/fsfs.conf
@@ -0,0 +1,37 @@
+### This file controls the configuration of the FSFS filesystem.
+
+[memcached-servers]
+### These options name memcached servers used to cache internal FSFS
+### data. See http://www.danga.com/memcached/ for more information on
+### memcached. To use memcached with FSFS, run one or more memcached
+### servers, and specify each of them as an option like so:
+# first-server = 127.0.0.1:11211
+# remote-memcached = mymemcached.corp.example.com:11212
+### The option name is ignored; the value is of the form HOST:PORT.
+### memcached servers can be shared between multiple repositories;
+### however, if you do this, you *must* ensure that repositories have
+### distinct UUIDs and paths, or else cached data from one repository
+### might be used by another accidentally. Note also that memcached has
+### no authentication for reads or writes, so you must ensure that your
+### memcached servers are only accessible by trusted users.
+
+[caches]
+### When a cache-related error occurs, normally Subversion ignores it
+### and continues, logging an error if the server is appropriately
+### configured (and ignoring it with file:// access). To make
+### Subversion never ignore cache errors, uncomment this line.
+# fail-stop = true
+
+[rep-sharing]
+### To conserve space, the filesystem can optionally avoid storing
+### duplicate representations. This comes at a slight cost in performace,
+### as maintaining a database of shared representations can increase
+### commit times. The space savings are dependent upon the size of the
+### repository, the number of objects it contains and the amount of
+### duplication between them, usually a function of the branching and
+### merging process.
+###
+### The following parameter enables rep-sharing in the repository. It can
+### be switched on and off at will, but for best space-saving results
+### should be enabled consistently over the life of the repository.
+# enable-rep-sharing = false
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d509748e/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/min-unpacked-rev
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/min-unpacked-rev b/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/min-unpacked-rev
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/min-unpacked-rev
@@ -0,0 +1 @@
+0
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d509748e/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/revprops/0/0
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/revprops/0/0 b/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/revprops/0/0
new file mode 100644
index 0000000..8d3fd9e
--- /dev/null
+++ b/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/revprops/0/0
@@ -0,0 +1,5 @@
+K 8
+svn:date
+V 27
+2013-08-08T12:37:19.542781Z
+END
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d509748e/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/revprops/0/1
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/revprops/0/1 b/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/revprops/0/1
new file mode 100644
index 0000000..2a381d9
--- /dev/null
+++ b/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/revprops/0/1
@@ -0,0 +1,13 @@
+K 10
+svn:author
+V 4
+root
+K 8
+svn:date
+V 27
+2013-08-08T12:38:04.489552Z
+K 7
+svn:log
+V 23
+Add initial directories
+END
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d509748e/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/revprops/0/2
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/revprops/0/2 b/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/revprops/0/2
new file mode 100644
index 0000000..144e101
--- /dev/null
+++ b/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/revprops/0/2
@@ -0,0 +1,13 @@
+K 10
+svn:author
+V 4
+root
+K 8
+svn:date
+V 27
+2013-08-08T12:39:43.351248Z
+K 7
+svn:log
+V 11
+file in dir
+END
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d509748e/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/revprops/0/3
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/revprops/0/3 b/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/revprops/0/3
new file mode 100644
index 0000000..a3a76ba
--- /dev/null
+++ b/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/revprops/0/3
@@ -0,0 +1,13 @@
+K 10
+svn:author
+V 4
+root
+K 8
+svn:date
+V 27
+2013-08-08T12:40:01.848949Z
+K 7
+svn:log
+V 6
+rename
+END
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d509748e/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/revs/0/0
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/revs/0/0 b/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/revs/0/0
new file mode 100644
index 0000000..10f5c45
--- /dev/null
+++ b/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/revs/0/0
@@ -0,0 +1,11 @@
+PLAIN
+END
+ENDREP
+id: 0.0.r0/17
+type: dir
+count: 0
+text: 0 0 4 4 2d2977d1c96f487abe4a1e202dd03b4e
+cpath: /
+
+
+17 107
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d509748e/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/revs/0/1
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/revs/0/1 b/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/revs/0/1
new file mode 100644
index 0000000..f2ad9f2
--- /dev/null
+++ b/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/revs/0/1
@@ -0,0 +1,49 @@
+id: 2-1.0.r1/0
+type: dir
+count: 0
+cpath: /tags
+copyroot: 0 /
+
+id: 3-1.0.r1/62
+type: dir
+count: 0
+cpath: /trunk
+copyroot: 0 /
+
+id: 0-1.0.r1/126
+type: dir
+count: 0
+cpath: /branches
+copyroot: 0 /
+
+PLAIN
+K 8
+branches
+V 16
+dir 0-1.0.r1/126
+K 4
+tags
+V 14
+dir 2-1.0.r1/0
+K 5
+trunk
+V 15
+dir 3-1.0.r1/62
+END
+ENDREP
+id: 0.0.r1/306
+type: dir
+pred: 0.0.r0/17
+count: 1
+text: 1 194 99 99 2a9153030baf0be3d36129055b365771
+cpath: /
+copyroot: 0 /
+
+_3.0.t0-0 add-dir false false /trunk
+
+_0.0.t0-0 add-dir false false /branches
+
+_2.0.t0-0 add-dir false false /tags
+
+
+306 431
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d509748e/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/revs/0/2
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/revs/0/2 b/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/revs/0/2
new file mode 100644
index 0000000..3621d6e
Binary files /dev/null and b/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/revs/0/2 differ
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d509748e/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/revs/0/3
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/revs/0/3 b/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/revs/0/3
new file mode 100644
index 0000000..dfc2340
--- /dev/null
+++ b/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/revs/0/3
@@ -0,0 +1,56 @@
+id: 2-2.0-3.r3/0
+type: file
+pred: 2-2.0.r2/31
+count: 1
+text: 2 0 18 6 58e3b26452d39a3b59fb382c0ba03bac 415b4467aab97d19ad3fd7beb8eeaa42c8330abc 1-1/_4
+cpath: /dir/b.txt
+copyfrom: 2 /dir/a.txt
+
+PLAIN
+K 5
+b.txt
+V 17
+file 2-2.0-3.r3/0
+END
+ENDREP
+id: 0-2.0.r3/243
+type: dir
+pred: 0-2.0.r2/245
+count: 1
+text: 3 193 37 37 1f4ffb88b2b1a84f68f687f7c6234093
+cpath: /dir
+copyroot: 0 /
+
+PLAIN
+K 8
+branches
+V 16
+dir 0-1.0.r1/126
+K 3
+dir
+V 16
+dir 0-2.0.r3/243
+K 4
+tags
+V 14
+dir 2-1.0.r1/0
+K 5
+trunk
+V 15
+dir 3-1.0.r1/62
+END
+ENDREP
+id: 0.0.r3/518
+type: dir
+pred: 0.0.r2/501
+count: 3
+text: 3 376 129 129 a5fed55ce83e9aefbeb6199207438b16
+cpath: /
+copyroot: 0 /
+
+2-2.0.r2/31 delete-file false false /dir/a.txt
+
+2-2._0.t2-2 add-file false false /dir/b.txt
+2 /dir/a.txt
+
+518 646
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d509748e/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/txn-current
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/txn-current b/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/txn-current
new file mode 100644
index 0000000..00750ed
--- /dev/null
+++ b/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/txn-current
@@ -0,0 +1 @@
+3
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d509748e/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/txn-current-lock
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/txn-current-lock b/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/txn-current-lock
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d509748e/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/uuid
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/uuid b/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/uuid
new file mode 100644
index 0000000..b82b6b3
--- /dev/null
+++ b/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/uuid
@@ -0,0 +1 @@
+7dc01617-2ce1-4b3d-96af-f7038e33c0a2
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d509748e/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/write-lock
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/write-lock b/ForgeSVN/forgesvn/tests/data/testsvn-rename/db/write-lock
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d509748e/ForgeSVN/forgesvn/tests/data/testsvn-rename/format
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/data/testsvn-rename/format b/ForgeSVN/forgesvn/tests/data/testsvn-rename/format
new file mode 100644
index 0000000..7ed6ff8
--- /dev/null
+++ b/ForgeSVN/forgesvn/tests/data/testsvn-rename/format
@@ -0,0 +1 @@
+5
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d509748e/ForgeSVN/forgesvn/tests/data/testsvn-rename/hooks/post-commit
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/data/testsvn-rename/hooks/post-commit b/ForgeSVN/forgesvn/tests/data/testsvn-rename/hooks/post-commit
new file mode 100755
index 0000000..5c81f51
--- /dev/null
+++ b/ForgeSVN/forgesvn/tests/data/testsvn-rename/hooks/post-commit
@@ -0,0 +1,8 @@
+#!/bin/bash
+# The following is required for site integration, do not remove/modify.
+# Place user hook code in post-commit-user and it will be called from here.
+curl -s http://localhost:8080/auth/refresh_repo/p/test2/code/
+
+DIR="$(dirname "${BASH_SOURCE[0]}")"
+if [ -x $DIR/post-commit-user ]; then exec $DIR/post-commit-user "$@"
+fi
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d509748e/ForgeSVN/forgesvn/tests/data/testsvn-rename/hooks/post-commit.tmpl
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/data/testsvn-rename/hooks/post-commit.tmpl b/ForgeSVN/forgesvn/tests/data/testsvn-rename/hooks/post-commit.tmpl
new file mode 100644
index 0000000..93c92ad
--- /dev/null
+++ b/ForgeSVN/forgesvn/tests/data/testsvn-rename/hooks/post-commit.tmpl
@@ -0,0 +1,50 @@
+#!/bin/sh
+
+# POST-COMMIT HOOK
+#
+# The post-commit hook is invoked after a commit. Subversion runs
+# this hook by invoking a program (script, executable, binary, etc.)
+# named 'post-commit' (for which this file is a template) with the
+# following ordered arguments:
+#
+# [1] REPOS-PATH (the path to this repository)
+# [2] REV (the number of the revision just committed)
+#
+# The default working directory for the invocation is undefined, so
+# the program should set one explicitly if it cares.
+#
+# Because the commit has already completed and cannot be undone,
+# the exit code of the hook program is ignored. The hook program
+# can use the 'svnlook' utility to help it examine the
+# newly-committed tree.
+#
+# On a Unix system, the normal procedure is to have 'post-commit'
+# invoke other programs to do the real work, though it may do the
+# work itself too.
+#
+# Note that 'post-commit' must be executable by the user(s) who will
+# invoke it (typically the user httpd runs as), and that user must
+# have filesystem-level permission to access the repository.
+#
+# On a Windows system, you should name the hook program
+# 'post-commit.bat' or 'post-commit.exe',
+# but the basic idea is the same.
+#
+# The hook program typically does not inherit the environment of
+# its parent process. For example, a common problem is for the
+# PATH environment variable to not be set to its usual value, so
+# that subprograms fail to launch unless invoked via absolute path.
+# If you're having unexpected problems with a hook program, the
+# culprit may be unusual (or missing) environment variables.
+#
+# Here is an example hook script, for a Unix /bin/sh interpreter.
+# For more examples and pre-written hooks, see those in
+# /usr/share/subversion/hook-scripts, and in the repository at
+# http://svn.apache.org/repos/asf/subversion/trunk/tools/hook-scripts/ and
+# http://svn.apache.org/repos/asf/subversion/trunk/contrib/hook-scripts/
+
+
+REPOS="$1"
+REV="$2"
+
+"$REPOS"/hooks/mailer.py commit "$REPOS" $REV "$REPOS"/mailer.conf
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d509748e/ForgeSVN/forgesvn/tests/data/testsvn-rename/hooks/post-lock.tmpl
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/data/testsvn-rename/hooks/post-lock.tmpl b/ForgeSVN/forgesvn/tests/data/testsvn-rename/hooks/post-lock.tmpl
new file mode 100644
index 0000000..beae9d7
--- /dev/null
+++ b/ForgeSVN/forgesvn/tests/data/testsvn-rename/hooks/post-lock.tmpl
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+# POST-LOCK HOOK
+#
+# The post-lock hook is run after a path is locked. Subversion runs
+# this hook by invoking a program (script, executable, binary, etc.)
+# named 'post-lock' (for which this file is a template) with the
+# following ordered arguments:
+#
+# [1] REPOS-PATH (the path to this repository)
+# [2] USER (the user who created the lock)
+#
+# The paths that were just locked are passed to the hook via STDIN (as
+# of Subversion 1.2, only one path is passed per invocation, but the
+# plan is to pass all locked paths at once, so the hook program
+# should be written accordingly).
+#
+# The default working directory for the invocation is undefined, so
+# the program should set one explicitly if it cares.
+#
+# Because the lock has already been created and cannot be undone,
+# the exit code of the hook program is ignored. The hook program
+# can use the 'svnlook' utility to help it examine the
+# newly-created lock.
+#
+# On a Unix system, the normal procedure is to have 'post-lock'
+# invoke other programs to do the real work, though it may do the
+# work itself too.
+#
+# Note that 'post-lock' must be executable by the user(s) who will
+# invoke it (typically the user httpd runs as), and that user must
+# have filesystem-level permission to access the repository.
+#
+# On a Windows system, you should name the hook program
+# 'post-lock.bat' or 'post-lock.exe',
+# but the basic idea is the same.
+#
+# Here is an example hook script, for a Unix /bin/sh interpreter:
+
+REPOS="$1"
+USER="$2"
+
+# Send email to interested parties, let them know a lock was created:
+"$REPOS"/hooks/mailer.py lock \
+ "$REPOS" "$USER" "$REPOS"/hooks/mailer.conf
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d509748e/ForgeSVN/forgesvn/tests/data/testsvn-rename/hooks/post-revprop-change.tmpl
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/data/testsvn-rename/hooks/post-revprop-change.tmpl b/ForgeSVN/forgesvn/tests/data/testsvn-rename/hooks/post-revprop-change.tmpl
new file mode 100644
index 0000000..cf7aedd
--- /dev/null
+++ b/ForgeSVN/forgesvn/tests/data/testsvn-rename/hooks/post-revprop-change.tmpl
@@ -0,0 +1,57 @@
+#!/bin/sh
+
+# POST-REVPROP-CHANGE HOOK
+#
+# The post-revprop-change hook is invoked after a revision property
+# has been added, modified or deleted. Subversion runs this hook by
+# invoking a program (script, executable, binary, etc.) named
+# 'post-revprop-change' (for which this file is a template), with the
+# following ordered arguments:
+#
+# [1] REPOS-PATH (the path to this repository)
+# [2] REV (the revision that was tweaked)
+# [3] USER (the username of the person tweaking the property)
+# [4] PROPNAME (the property that was changed)
+# [5] ACTION (the property was 'A'dded, 'M'odified, or 'D'eleted)
+#
+# [STDIN] PROPVAL ** the old property value is passed via STDIN.
+#
+# Because the propchange has already completed and cannot be undone,
+# the exit code of the hook program is ignored. The hook program
+# can use the 'svnlook' utility to help it examine the
+# new property value.
+#
+# On a Unix system, the normal procedure is to have 'post-revprop-change'
+# invoke other programs to do the real work, though it may do the
+# work itself too.
+#
+# Note that 'post-revprop-change' must be executable by the user(s) who will
+# invoke it (typically the user httpd runs as), and that user must
+# have filesystem-level permission to access the repository.
+#
+# On a Windows system, you should name the hook program
+# 'post-revprop-change.bat' or 'post-revprop-change.exe',
+# but the basic idea is the same.
+#
+# The hook program typically does not inherit the environment of
+# its parent process. For example, a common problem is for the
+# PATH environment variable to not be set to its usual value, so
+# that subprograms fail to launch unless invoked via absolute path.
+# If you're having unexpected problems with a hook program, the
+# culprit may be unusual (or missing) environment variables.
+#
+# Here is an example hook script, for a Unix /bin/sh interpreter.
+# For more examples and pre-written hooks, see those in
+# /usr/share/subversion/hook-scripts, and in the repository at
+# http://svn.apache.org/repos/asf/subversion/trunk/tools/hook-scripts/ and
+# http://svn.apache.org/repos/asf/subversion/trunk/contrib/hook-scripts/
+
+
+REPOS="$1"
+REV="$2"
+USER="$3"
+PROPNAME="$4"
+ACTION="$5"
+
+"$REPOS"/hooks/mailer.py propchange2 "$REPOS" $REV \
+ "$USER" "$PROPNAME" "$ACTION" "$REPOS"/hooks/mailer.conf
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d509748e/ForgeSVN/forgesvn/tests/data/testsvn-rename/hooks/post-unlock.tmpl
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/data/testsvn-rename/hooks/post-unlock.tmpl b/ForgeSVN/forgesvn/tests/data/testsvn-rename/hooks/post-unlock.tmpl
new file mode 100644
index 0000000..277569f
--- /dev/null
+++ b/ForgeSVN/forgesvn/tests/data/testsvn-rename/hooks/post-unlock.tmpl
@@ -0,0 +1,43 @@
+#!/bin/sh
+
+# POST-UNLOCK HOOK
+#
+# The post-unlock hook runs after a path is unlocked. Subversion runs
+# this hook by invoking a program (script, executable, binary, etc.)
+# named 'post-unlock' (for which this file is a template) with the
+# following ordered arguments:
+#
+# [1] REPOS-PATH (the path to this repository)
+# [2] USER (the user who destroyed the lock)
+#
+# The paths that were just unlocked are passed to the hook via STDIN
+# (as of Subversion 1.2, only one path is passed per invocation, but
+# the plan is to pass all unlocked paths at once, so the hook program
+# should be written accordingly).
+#
+# The default working directory for the invocation is undefined, so
+# the program should set one explicitly if it cares.
+#
+# Because the lock has already been destroyed and cannot be undone,
+# the exit code of the hook program is ignored.
+#
+# On a Unix system, the normal procedure is to have 'post-unlock'
+# invoke other programs to do the real work, though it may do the
+# work itself too.
+#
+# Note that 'post-unlock' must be executable by the user(s) who will
+# invoke it (typically the user httpd runs as), and that user must
+# have filesystem-level permission to access the repository.
+#
+# On a Windows system, you should name the hook program
+# 'post-unlock.bat' or 'post-unlock.exe',
+# but the basic idea is the same.
+#
+# Here is an example hook script, for a Unix /bin/sh interpreter:
+
+REPOS="$1"
+USER="$2"
+
+# Send email to interested parties, let them know a lock was removed:
+"$REPOS"/hooks/mailer.py unlock \
+ "$REPOS" "$USER" "$REPOS"/hooks/mailer.conf
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d509748e/ForgeSVN/forgesvn/tests/data/testsvn-rename/hooks/pre-commit.tmpl
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/data/testsvn-rename/hooks/pre-commit.tmpl b/ForgeSVN/forgesvn/tests/data/testsvn-rename/hooks/pre-commit.tmpl
new file mode 100644
index 0000000..44c24b9
--- /dev/null
+++ b/ForgeSVN/forgesvn/tests/data/testsvn-rename/hooks/pre-commit.tmpl
@@ -0,0 +1,85 @@
+#!/bin/sh
+
+# PRE-COMMIT HOOK
+#
+# The pre-commit hook is invoked before a Subversion txn is
+# committed. Subversion runs this hook by invoking a program
+# (script, executable, binary, etc.) named 'pre-commit' (for which
+# this file is a template), with the following ordered arguments:
+#
+# [1] REPOS-PATH (the path to this repository)
+# [2] TXN-NAME (the name of the txn about to be committed)
+#
+# [STDIN] LOCK-TOKENS ** the lock tokens are passed via STDIN.
+#
+# If STDIN contains the line "LOCK-TOKENS:\n" (the "\n" denotes a
+# single newline), the lines following it are the lock tokens for
+# this commit. The end of the list is marked by a line containing
+# only a newline character.
+#
+# Each lock token line consists of a URI-escaped path, followed
+# by the separator character '|', followed by the lock token string,
+# followed by a newline.
+#
+# The default working directory for the invocation is undefined, so
+# the program should set one explicitly if it cares.
+#
+# If the hook program exits with success, the txn is committed; but
+# if it exits with failure (non-zero), the txn is aborted, no commit
+# takes place, and STDERR is returned to the client. The hook
+# program can use the 'svnlook' utility to help it examine the txn.
+#
+# On a Unix system, the normal procedure is to have 'pre-commit'
+# invoke other programs to do the real work, though it may do the
+# work itself too.
+#
+# *** NOTE: THE HOOK PROGRAM MUST NOT MODIFY THE TXN, EXCEPT ***
+# *** FOR REVISION PROPERTIES (like svn:log or svn:author). ***
+#
+# This is why we recommend using the read-only 'svnlook' utility.
+# In the future, Subversion may enforce the rule that pre-commit
+# hooks should not modify the versioned data in txns, or else come
+# up with a mechanism to make it safe to do so (by informing the
+# committing client of the changes). However, right now neither
+# mechanism is implemented, so hook writers just have to be careful.
+#
+# Note that 'pre-commit' must be executable by the user(s) who will
+# invoke it (typically the user httpd runs as), and that user must
+# have filesystem-level permission to access the repository.
+#
+# On a Windows system, you should name the hook program
+# 'pre-commit.bat' or 'pre-commit.exe',
+# but the basic idea is the same.
+#
+# The hook program typically does not inherit the environment of
+# its parent process. For example, a common problem is for the
+# PATH environment variable to not be set to its usual value, so
+# that subprograms fail to launch unless invoked via absolute path.
+# If you're having unexpected problems with a hook program, the
+# culprit may be unusual (or missing) environment variables.
+#
+# Here is an example hook script, for a Unix /bin/sh interpreter.
+# For more examples and pre-written hooks, see those in
+# /usr/share/subversion/hook-scripts, and in the repository at
+# http://svn.apache.org/repos/asf/subversion/trunk/tools/hook-scripts/ and
+# http://svn.apache.org/repos/asf/subversion/trunk/contrib/hook-scripts/
+
+
+REPOS="$1"
+TXN="$2"
+
+# Make sure that the log message contains some text.
+SVNLOOK=/usr/bin/svnlook
+$SVNLOOK log -t "$TXN" "$REPOS" | \
+ grep "[a-zA-Z0-9]" > /dev/null || exit 1
+
+# Exit on all errors.
+set -e
+
+# Check that the author of this commit has the rights to perform
+# the commit on the files and directories being modified.
+"$REPOS"/hooks/commit-access-control.pl "$REPOS" $TXN \
+ "$REPOS"/hooks/commit-access-control.cfg
+
+# All checks passed, so allow the commit.
+exit 0
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d509748e/ForgeSVN/forgesvn/tests/data/testsvn-rename/hooks/pre-lock.tmpl
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/data/testsvn-rename/hooks/pre-lock.tmpl b/ForgeSVN/forgesvn/tests/data/testsvn-rename/hooks/pre-lock.tmpl
new file mode 100644
index 0000000..13827fb
--- /dev/null
+++ b/ForgeSVN/forgesvn/tests/data/testsvn-rename/hooks/pre-lock.tmpl
@@ -0,0 +1,71 @@
+#!/bin/sh
+
+# PRE-LOCK HOOK
+#
+# The pre-lock hook is invoked before an exclusive lock is
+# created. Subversion runs this hook by invoking a program
+# (script, executable, binary, etc.) named 'pre-lock' (for which
+# this file is a template), with the following ordered arguments:
+#
+# [1] REPOS-PATH (the path to this repository)
+# [2] PATH (the path in the repository about to be locked)
+# [3] USER (the user creating the lock)
+# [4] COMMENT (the comment of the lock)
+# [5] STEAL-LOCK (1 if the user is trying to steal the lock, else 0)
+#
+# If the hook program outputs anything on stdout, the output string will
+# be used as the lock token for this lock operation. If you choose to use
+# this feature, you must guarantee the tokens generated are unique across
+# the repository each time.
+#
+# The default working directory for the invocation is undefined, so
+# the program should set one explicitly if it cares.
+#
+# If the hook program exits with success, the lock is created; but
+# if it exits with failure (non-zero), the lock action is aborted
+# and STDERR is returned to the client.
+
+# On a Unix system, the normal procedure is to have 'pre-lock'
+# invoke other programs to do the real work, though it may do the
+# work itself too.
+#
+# Note that 'pre-lock' must be executable by the user(s) who will
+# invoke it (typically the user httpd runs as), and that user must
+# have filesystem-level permission to access the repository.
+#
+# On a Windows system, you should name the hook program
+# 'pre-lock.bat' or 'pre-lock.exe',
+# but the basic idea is the same.
+#
+# Here is an example hook script, for a Unix /bin/sh interpreter:
+
+REPOS="$1"
+PATH="$2"
+USER="$3"
+
+# If a lock exists and is owned by a different person, don't allow it
+# to be stolen (e.g., with 'svn lock --force ...').
+
+# (Maybe this script could send email to the lock owner?)
+SVNLOOK=/usr/bin/svnlook
+GREP=/bin/grep
+SED=/bin/sed
+
+LOCK_OWNER=`$SVNLOOK lock "$REPOS" "$PATH" | \
+ $GREP '^Owner: ' | $SED 's/Owner: //'`
+
+# If we get no result from svnlook, there's no lock, allow the lock to
+# happen:
+if [ "$LOCK_OWNER" = "" ]; then
+ exit 0
+fi
+
+# If the person locking matches the lock's owner, allow the lock to
+# happen:
+if [ "$LOCK_OWNER" = "$USER" ]; then
+ exit 0
+fi
+
+# Otherwise, we've got an owner mismatch, so return failure:
+echo "Error: $PATH already locked by ${LOCK_OWNER}." 1>&2
+exit 1
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d509748e/ForgeSVN/forgesvn/tests/data/testsvn-rename/hooks/pre-revprop-change.tmpl
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/data/testsvn-rename/hooks/pre-revprop-change.tmpl b/ForgeSVN/forgesvn/tests/data/testsvn-rename/hooks/pre-revprop-change.tmpl
new file mode 100644
index 0000000..576fb36
--- /dev/null
+++ b/ForgeSVN/forgesvn/tests/data/testsvn-rename/hooks/pre-revprop-change.tmpl
@@ -0,0 +1,66 @@
+#!/bin/sh
+
+# PRE-REVPROP-CHANGE HOOK
+#
+# The pre-revprop-change hook is invoked before a revision property
+# is added, modified or deleted. Subversion runs this hook by invoking
+# a program (script, executable, binary, etc.) named 'pre-revprop-change'
+# (for which this file is a template), with the following ordered
+# arguments:
+#
+# [1] REPOS-PATH (the path to this repository)
+# [2] REVISION (the revision being tweaked)
+# [3] USER (the username of the person tweaking the property)
+# [4] PROPNAME (the property being set on the revision)
+# [5] ACTION (the property is being 'A'dded, 'M'odified, or 'D'eleted)
+#
+# [STDIN] PROPVAL ** the new property value is passed via STDIN.
+#
+# If the hook program exits with success, the propchange happens; but
+# if it exits with failure (non-zero), the propchange doesn't happen.
+# The hook program can use the 'svnlook' utility to examine the
+# existing value of the revision property.
+#
+# WARNING: unlike other hooks, this hook MUST exist for revision
+# properties to be changed. If the hook does not exist, Subversion
+# will behave as if the hook were present, but failed. The reason
+# for this is that revision properties are UNVERSIONED, meaning that
+# a successful propchange is destructive; the old value is gone
+# forever. We recommend the hook back up the old value somewhere.
+#
+# On a Unix system, the normal procedure is to have 'pre-revprop-change'
+# invoke other programs to do the real work, though it may do the
+# work itself too.
+#
+# Note that 'pre-revprop-change' must be executable by the user(s) who will
+# invoke it (typically the user httpd runs as), and that user must
+# have filesystem-level permission to access the repository.
+#
+# On a Windows system, you should name the hook program
+# 'pre-revprop-change.bat' or 'pre-revprop-change.exe',
+# but the basic idea is the same.
+#
+# The hook program typically does not inherit the environment of
+# its parent process. For example, a common problem is for the
+# PATH environment variable to not be set to its usual value, so
+# that subprograms fail to launch unless invoked via absolute path.
+# If you're having unexpected problems with a hook program, the
+# culprit may be unusual (or missing) environment variables.
+#
+# Here is an example hook script, for a Unix /bin/sh interpreter.
+# For more examples and pre-written hooks, see those in
+# /usr/share/subversion/hook-scripts, and in the repository at
+# http://svn.apache.org/repos/asf/subversion/trunk/tools/hook-scripts/ and
+# http://svn.apache.org/repos/asf/subversion/trunk/contrib/hook-scripts/
+
+
+REPOS="$1"
+REV="$2"
+USER="$3"
+PROPNAME="$4"
+ACTION="$5"
+
+if [ "$ACTION" = "M" -a "$PROPNAME" = "svn:log" ]; then exit 0; fi
+
+echo "Changing revision properties other than svn:log is prohibited" >&2
+exit 1
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d509748e/ForgeSVN/forgesvn/tests/data/testsvn-rename/hooks/pre-unlock.tmpl
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/data/testsvn-rename/hooks/pre-unlock.tmpl b/ForgeSVN/forgesvn/tests/data/testsvn-rename/hooks/pre-unlock.tmpl
new file mode 100644
index 0000000..d1aa858
--- /dev/null
+++ b/ForgeSVN/forgesvn/tests/data/testsvn-rename/hooks/pre-unlock.tmpl
@@ -0,0 +1,63 @@
+#!/bin/sh
+
+# PRE-UNLOCK HOOK
+#
+# The pre-unlock hook is invoked before an exclusive lock is
+# destroyed. Subversion runs this hook by invoking a program
+# (script, executable, binary, etc.) named 'pre-unlock' (for which
+# this file is a template), with the following ordered arguments:
+#
+# [1] REPOS-PATH (the path to this repository)
+# [2] PATH (the path in the repository about to be unlocked)
+# [3] USER (the user destroying the lock)
+# [4] TOKEN (the lock token to be destroyed)
+# [5] BREAK-UNLOCK (1 if the user is breaking the lock, else 0)
+#
+# The default working directory for the invocation is undefined, so
+# the program should set one explicitly if it cares.
+#
+# If the hook program exits with success, the lock is destroyed; but
+# if it exits with failure (non-zero), the unlock action is aborted
+# and STDERR is returned to the client.
+
+# On a Unix system, the normal procedure is to have 'pre-unlock'
+# invoke other programs to do the real work, though it may do the
+# work itself too.
+#
+# Note that 'pre-unlock' must be executable by the user(s) who will
+# invoke it (typically the user httpd runs as), and that user must
+# have filesystem-level permission to access the repository.
+#
+# On a Windows system, you should name the hook program
+# 'pre-unlock.bat' or 'pre-unlock.exe',
+# but the basic idea is the same.
+#
+# Here is an example hook script, for a Unix /bin/sh interpreter:
+
+REPOS="$1"
+PATH="$2"
+USER="$3"
+
+# If a lock is owned by a different person, don't allow it be broken.
+# (Maybe this script could send email to the lock owner?)
+
+SVNLOOK=/usr/bin/svnlook
+GREP=/bin/grep
+SED=/bin/sed
+
+LOCK_OWNER=`$SVNLOOK lock "$REPOS" "$PATH" | \
+ $GREP '^Owner: ' | $SED 's/Owner: //'`
+
+# If we get no result from svnlook, there's no lock, return success:
+if [ "$LOCK_OWNER" = "" ]; then
+ exit 0
+fi
+
+# If the person unlocking matches the lock's owner, return success:
+if [ "$LOCK_OWNER" = "$USER" ]; then
+ exit 0
+fi
+
+# Otherwise, we've got an owner mismatch, so return failure:
+echo "Error: $PATH locked by ${LOCK_OWNER}." 1>&2
+exit 1
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d509748e/ForgeSVN/forgesvn/tests/data/testsvn-rename/hooks/start-commit.tmpl
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/data/testsvn-rename/hooks/start-commit.tmpl b/ForgeSVN/forgesvn/tests/data/testsvn-rename/hooks/start-commit.tmpl
new file mode 100644
index 0000000..c10868f
--- /dev/null
+++ b/ForgeSVN/forgesvn/tests/data/testsvn-rename/hooks/start-commit.tmpl
@@ -0,0 +1,68 @@
+#!/bin/sh
+
+# START-COMMIT HOOK
+#
+# The start-commit hook is invoked before a Subversion txn is created
+# in the process of doing a commit. Subversion runs this hook
+# by invoking a program (script, executable, binary, etc.) named
+# 'start-commit' (for which this file is a template)
+# with the following ordered arguments:
+#
+# [1] REPOS-PATH (the path to this repository)
+# [2] USER (the authenticated user attempting to commit)
+# [3] CAPABILITIES (a colon-separated list of capabilities reported
+# by the client; see note below)
+#
+# Note: The CAPABILITIES parameter is new in Subversion 1.5, and 1.5
+# clients will typically report at least the "mergeinfo" capability.
+# If there are other capabilities, then the list is colon-separated,
+# e.g.: "mergeinfo:some-other-capability" (the order is undefined).
+#
+# The list is self-reported by the client. Therefore, you should not
+# make security assumptions based on the capabilities list, nor should
+# you assume that clients reliably report every capability they have.
+#
+# The working directory for this hook program's invocation is undefined,
+# so the program should set one explicitly if it cares.
+#
+# If the hook program exits with success, the commit continues; but
+# if it exits with failure (non-zero), the commit is stopped before
+# a Subversion txn is created, and STDERR is returned to the client.
+#
+# On a Unix system, the normal procedure is to have 'start-commit'
+# invoke other programs to do the real work, though it may do the
+# work itself too.
+#
+# Note that 'start-commit' must be executable by the user(s) who will
+# invoke it (typically the user httpd runs as), and that user must
+# have filesystem-level permission to access the repository.
+#
+# On a Windows system, you should name the hook program
+# 'start-commit.bat' or 'start-commit.exe',
+# but the basic idea is the same.
+#
+# The hook program typically does not inherit the environment of
+# its parent process. For example, a common problem is for the
+# PATH environment variable to not be set to its usual value, so
+# that subprograms fail to launch unless invoked via absolute path.
+# If you're having unexpected problems with a hook program, the
+# culprit may be unusual (or missing) environment variables.
+#
+# Here is an example hook script, for a Unix /bin/sh interpreter.
+# For more examples and pre-written hooks, see those in
+# /usr/share/subversion/hook-scripts, and in the repository at
+# http://svn.apache.org/repos/asf/subversion/trunk/tools/hook-scripts/ and
+# http://svn.apache.org/repos/asf/subversion/trunk/contrib/hook-scripts/
+
+
+REPOS="$1"
+USER="$2"
+
+# Exit on all errors.
+set -e
+
+"$REPOS"/hooks/commit-allower.pl --repository "$REPOS" --user "$USER"
+"$REPOS"/hooks/special-auth-check.py --user "$USER" --auth-level 3
+
+# All checks passed, so allow the commit.
+exit 0
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d509748e/ForgeSVN/forgesvn/tests/data/testsvn-rename/locks/db-logs.lock
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/data/testsvn-rename/locks/db-logs.lock b/ForgeSVN/forgesvn/tests/data/testsvn-rename/locks/db-logs.lock
new file mode 100644
index 0000000..20dd636
--- /dev/null
+++ b/ForgeSVN/forgesvn/tests/data/testsvn-rename/locks/db-logs.lock
@@ -0,0 +1,3 @@
+This file is not used by Subversion 1.3.x or later.
+However, its existence is required for compatibility with
+Subversion 1.2.x or earlier.
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d509748e/ForgeSVN/forgesvn/tests/data/testsvn-rename/locks/db.lock
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/data/testsvn-rename/locks/db.lock b/ForgeSVN/forgesvn/tests/data/testsvn-rename/locks/db.lock
new file mode 100644
index 0000000..20dd636
--- /dev/null
+++ b/ForgeSVN/forgesvn/tests/data/testsvn-rename/locks/db.lock
@@ -0,0 +1,3 @@
+This file is not used by Subversion 1.3.x or later.
+However, its existence is required for compatibility with
+Subversion 1.2.x or earlier.
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d509748e/ForgeSVN/forgesvn/tests/functional/test_controllers.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/functional/test_controllers.py b/ForgeSVN/forgesvn/tests/functional/test_controllers.py
index 16fd989..eb7d409 100644
--- a/ForgeSVN/forgesvn/tests/functional/test_controllers.py
+++ b/ForgeSVN/forgesvn/tests/functional/test_controllers.py
@@ -274,3 +274,30 @@ class TestImportController(SVNTestController):
r = self.app.post('/p/test/admin/empty/importer/do_import',
{'checkout_url': 'http://fake.svn/'})
assert tasks.reclone.post.called
+
+
+class SVNTestRenames(TestController):
+ def setUp(self):
+ TestController.setUp(self)
+ self.setup_with_tools()
+
+ @with_svn
+ def setup_with_tools(self):
+ h.set_context('test', 'src', neighborhood='Projects')
+ repo_dir = pkg_resources.resource_filename(
+ 'forgesvn', 'tests/data/')
+ c.app.repo.fs_path = repo_dir
+ c.app.repo.status = 'ready'
+ c.app.repo.name = 'testsvn'
+ ThreadLocalORMSession.flush_all()
+ ThreadLocalORMSession.close_all()
+ h.set_context('test', 'src', neighborhood='Projects')
+ c.app.repo.refresh()
+ ThreadLocalORMSession.flush_all()
+ ThreadLocalORMSession.close_all()
+ h.set_context('test', 'src', neighborhood='Projects')
+
+ def test_log(self):
+ r = self.app.get('/src/3/log/?path=/dir/b.txt')
+ assert '<b>renamed from</b>' in r
+ assert '/dir/a.txt' in r
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d509748e/ForgeSVN/forgesvn/tests/model/test_repository.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/model/test_repository.py b/ForgeSVN/forgesvn/tests/model/test_repository.py
index e47158f..2ed5de3 100644
--- a/ForgeSVN/forgesvn/tests/model/test_repository.py
+++ b/ForgeSVN/forgesvn/tests/model/test_repository.py
@@ -237,7 +237,8 @@ class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
'message': u'Copied a => b',
'parents': [4],
'refs': ['HEAD'],
- 'size': 0},
+ 'size': 0,
+ 'rename_details':{}},
{'authored': {'date': datetime(2010, 10, 8, 15, 32, 59, 383719),
'email': '',
'name': u'rick446'},
@@ -248,7 +249,8 @@ class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
'message': u'Remove hello.txt',
'parents': [3],
'refs': [],
- 'size': 0},
+ 'size': 0,
+ 'rename_details':{}},
{'authored': {'date': datetime(2010, 10, 8, 15, 32, 48, 272296),
'email': '',
'name': u'rick446'},
@@ -259,7 +261,8 @@ class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
'message': u'Modify readme',
'parents': [2],
'refs': [],
- 'size': 0},
+ 'size': 0,
+ 'rename_details':{}},
{'authored': {'date': datetime(2010, 10, 8, 15, 32, 36, 221863),
'email': '',
'name': u'rick446'},
@@ -270,7 +273,8 @@ class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
'message': u'Add path',
'parents': [1],
'refs': [],
- 'size': 0},
+ 'size': 0,
+ 'rename_details':{}},
{'authored': {'date': datetime(2010, 10, 8, 15, 32, 7, 238375),
'email': '',
'name': u'rick446'},
@@ -281,7 +285,8 @@ class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
'message': u'Create readme',
'parents': [],
'refs': [],
- 'size': 0},
+ 'size': 0,
+ 'rename_details':{}},
])
def test_log_file(self):
@@ -297,7 +302,8 @@ class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
'message': u'Modify readme',
'parents': [2],
'refs': [],
- 'size': 28},
+ 'size': 28,
+ 'rename_details': {}},
{'authored': {'date': datetime(2010, 10, 8, 15, 32, 7, 238375),
'email': '',
'name': u'rick446'},
@@ -308,7 +314,8 @@ class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
'message': u'Create readme',
'parents': [],
'refs': [],
- 'size': 28},
+ 'size': 28,
+ 'rename_details': {}},
])
def test_is_file(self):
@@ -846,7 +853,7 @@ class TestMergeRequest(_TestWithRepoAndCommit):
assert_equal(_svn().log.call_args[0], ('file:///tmp/svn/p/test/test2',))
assert_equal(_svn().log.call_args[1]['revision_start'].number, 2)
assert_equal(_svn().log.call_args[1]['limit'], 25)
- _map_log.assert_called_once_with(_svn().log.return_value[0], 'file:///tmp/svn/p/test/test2')
+ _map_log.assert_called_once_with(_svn().log.return_value[0], 'file:///tmp/svn/p/test/test2', None)
class TestRepoObject(_TestWithRepoAndCommit):
@@ -1010,3 +1017,36 @@ class TestCommit(_TestWithRepo):
def test_context(self):
self.ci.context()
+
+
+class TestRename(unittest.TestCase):
+
+ def setUp(self):
+ setup_basic_test()
+ self.setup_with_tools()
+
+ @with_svn
+ def setup_with_tools(self):
+ setup_global_objects()
+ h.set_context('test', 'src', neighborhood='Projects')
+ repo_dir = pkg_resources.resource_filename(
+ 'forgesvn', 'tests/data/')
+ self.repo = SM.Repository(
+ name='testsvn-rename',
+ fs_path=repo_dir,
+ url_path = '/test/',
+ tool = 'svn',
+ status = 'creating')
+ self.repo.refresh()
+ self.rev = self.repo.commit('HEAD')
+ ThreadLocalORMSession.flush_all()
+ ThreadLocalORMSession.close_all()
+
+ def test_log_file_with_rename(self):
+ entry = list(self.repo.log(path='/dir/b.txt', id_only=False))[0]
+ assert_equal(entry['id'], 3)
+ assert_equal(entry['rename_details']['path'], '/dir/a.txt')
+ assert_equal(
+ entry['rename_details']['commit_url'],
+ self.repo.url_for_commit(2) # previous revision
+ )
[02/29] git commit: [#6611] provide mechanism to disable any allura
entry point
Posted by tv...@apache.org.
[#6611] provide mechanism to disable any allura entry point
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/1581f299
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/1581f299
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/1581f299
Branch: refs/heads/tv/6457
Commit: 1581f299c20aa4babfa8a5a1f781625e49534346
Parents: 10cb90c
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Wed Aug 28 19:05:30 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Wed Aug 28 19:05:38 2013 +0000
----------------------------------------------------------------------
Allura/allura/command/base.py | 3 +--
Allura/allura/config/resources.py | 6 ++++--
Allura/allura/controllers/project.py | 4 ++--
Allura/allura/ext/admin/admin_main.py | 2 +-
Allura/allura/lib/app_globals.py | 2 +-
Allura/allura/lib/custom_middleware.py | 4 ++--
Allura/allura/lib/helpers.py | 12 +++++++++++-
Allura/allura/lib/package_path_loader.py | 7 +++----
Allura/allura/model/auth.py | 1 -
Allura/docs/extending.rst | 10 +++++++++-
ForgeImporters/forgeimporters/base.py | 10 ++++------
ForgeImporters/forgeimporters/tests/test_base.py | 8 ++++----
scripts/rethumb.py | 6 ++++--
13 files changed, 46 insertions(+), 29 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/1581f299/Allura/allura/command/base.py
----------------------------------------------------------------------
diff --git a/Allura/allura/command/base.py b/Allura/allura/command/base.py
index 536159d..38bb0d5 100644
--- a/Allura/allura/command/base.py
+++ b/Allura/allura/command/base.py
@@ -20,7 +20,6 @@ import sys
import logging
import shlex
from multiprocessing import Process
-from pkg_resources import iter_entry_points
import pylons
from paste.script import command
@@ -31,6 +30,7 @@ import activitystream
import ming
from allura.config.environment import load_environment
from allura.lib.decorators import task
+from allura.lib.helpers import iter_entry_points
log = None
@@ -117,4 +117,3 @@ class Command(command.Command):
def teardown_globals(self):
self.registry.cleanup()
-
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/1581f299/Allura/allura/config/resources.py
----------------------------------------------------------------------
diff --git a/Allura/allura/config/resources.py b/Allura/allura/config/resources.py
index 9122687..6e231e4 100644
--- a/Allura/allura/config/resources.py
+++ b/Allura/allura/config/resources.py
@@ -20,6 +20,8 @@ import logging
import pkg_resources
+from allura.lib.helpers import iter_entry_points
+
log = logging.getLogger(__name__)
def register_ew_resources(manager):
@@ -29,7 +31,7 @@ def register_ew_resources(manager):
'css', pkg_resources.resource_filename('allura', 'lib/widgets/resources/css'))
manager.register_directory(
'allura', pkg_resources.resource_filename('allura', 'public/nf'))
- for ep in pkg_resources.iter_entry_points('allura'):
+ for ep in iter_entry_points('allura'):
try:
manager.register_directory(
'tool/%s' % ep.name.lower(),
@@ -39,7 +41,7 @@ def register_ew_resources(manager):
except ImportError:
log.warning('Cannot import entry point %s', ep)
raise
- for ep in pkg_resources.iter_entry_points('allura.theme'):
+ for ep in iter_entry_points('allura.theme'):
try:
theme = ep.load()
theme.register_ew_resources(manager, ep.name)
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/1581f299/Allura/allura/controllers/project.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/project.py b/Allura/allura/controllers/project.py
index 5f293a6..9914dc9 100644
--- a/Allura/allura/controllers/project.py
+++ b/Allura/allura/controllers/project.py
@@ -20,7 +20,6 @@ import logging
from datetime import datetime, timedelta
from urllib import unquote
from itertools import chain, islice
-from pkg_resources import iter_entry_points
from bson import ObjectId
from tg import expose, flash, redirect, validate, request, response, config
@@ -38,6 +37,7 @@ from allura import model as M
from allura.app import SitemapEntry
from allura.lib.base import WsgiDispatchController
from allura.lib import helpers as h
+from allura.lib.helpers import iter_entry_points
from allura.lib import utils
from allura.lib.decorators import require_post
from allura.controllers.error import ErrorController
@@ -310,7 +310,7 @@ class ProjectController(FeedController):
for s in c.project.grouped_navbar_entries():
entry = dict(name=s.label, url=s.url, icon=s.ui_icon, tool_name=s.tool_name)
if s.children:
- entry['children'] = [dict(name=child.label, url=child.url, icon=child.ui_icon, tool_name=child.tool_name)
+ entry['children'] = [dict(name=child.label, url=child.url, icon=child.ui_icon, tool_name=child.tool_name)
for child in s.children]
menu.append(entry)
return dict(menu=menu)
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/1581f299/Allura/allura/ext/admin/admin_main.py
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/admin_main.py b/Allura/allura/ext/admin/admin_main.py
index 22bd228..314c3a9 100644
--- a/Allura/allura/ext/admin/admin_main.py
+++ b/Allura/allura/ext/admin/admin_main.py
@@ -292,7 +292,7 @@ class ProjectAdminController(BaseController):
'<input name="source_url">'
'<input type="submit">'
'</form>')
- for ep in pkg_resources.iter_entry_points('allura', repo_type):
+ for ep in h.iter_entry_points('allura', repo_type):
break
if ep is None or source_url is None:
raise exc.HTTPNotFound
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/1581f299/Allura/allura/lib/app_globals.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/app_globals.py b/Allura/allura/lib/app_globals.py
index 7f45f69..276af63 100644
--- a/Allura/allura/lib/app_globals.py
+++ b/Allura/allura/lib/app_globals.py
@@ -178,7 +178,7 @@ class Globals(object):
# Cache some loaded entry points
def _cache_eps(section_name, dict_cls=dict):
d = dict_cls()
- for ep in pkg_resources.iter_entry_points(section_name):
+ for ep in h.iter_entry_points(section_name):
value = ep.load()
d[ep.name] = value
return d
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/1581f299/Allura/allura/lib/custom_middleware.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/custom_middleware.py b/Allura/allura/lib/custom_middleware.py
index 4458c48..d4652ab 100644
--- a/Allura/allura/lib/custom_middleware.py
+++ b/Allura/allura/lib/custom_middleware.py
@@ -35,7 +35,7 @@ import allura.model.repo
log = logging.getLogger(__name__)
-tool_entry_points = list(pkg_resources.iter_entry_points('allura'))
+tool_entry_points = list(h.iter_entry_points('allura'))
class StaticFilesMiddleware(object):
'''Custom static file middleware
@@ -169,7 +169,7 @@ class SSLMiddleware(object):
if not resp:
resp = self.app
return resp(environ, start_response)
-
+
class AlluraTimerMiddleware(TimerMiddleware):
def timers(self):
import genshi
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/1581f299/Allura/allura/lib/helpers.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/helpers.py b/Allura/allura/lib/helpers.py
index b7b0060..3715de6 100644
--- a/Allura/allura/lib/helpers.py
+++ b/Allura/allura/lib/helpers.py
@@ -49,7 +49,7 @@ from tg.decorators import before_validate
from formencode.variabledecode import variable_decode
import formencode
from jinja2 import Markup
-from paste.deploy.converters import asbool
+from paste.deploy.converters import asbool, aslist
from webhelpers import date, feedgenerator, html, number, misc, text
@@ -984,3 +984,13 @@ def plain2markdown(text, preserve_multiple_spaces=False, has_html_entities=False
text = re_angle_bracket_open.sub('<', text)
text = re_angle_bracket_close.sub('>', text)
return text
+
+
+def iter_entry_points(group, *a, **kw):
+ '''
+ yield entry points that have not been disabled in the config
+ '''
+ disabled = aslist(tg.config.get('disable_entry_points.' + group), sep=',')
+ for ep in pkg_resources.iter_entry_points(group, *a, **kw):
+ if ep.name not in disabled:
+ yield ep
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/1581f299/Allura/allura/lib/package_path_loader.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/package_path_loader.py b/Allura/allura/lib/package_path_loader.py
index 9bee4c4..8272acf 100644
--- a/Allura/allura/lib/package_path_loader.py
+++ b/Allura/allura/lib/package_path_loader.py
@@ -124,12 +124,11 @@ The positioners are:
"""
import pkg_resources
import os
-from collections import defaultdict
import jinja2
from ming.utils import LazyProperty
-from allura.lib.helpers import topological_sort
+from allura.lib.helpers import topological_sort, iter_entry_points
class PackagePathLoader(jinja2.BaseLoader):
@@ -163,7 +162,7 @@ class PackagePathLoader(jinja2.BaseLoader):
paths = self.default_paths[:] # copy default_paths
paths[-1:0] = [ # insert all eps just before last item, by default
[ep.name, pkg_resources.resource_filename(ep.module_name, "")]
- for ep in pkg_resources.iter_entry_points(self.override_entrypoint)
+ for ep in iter_entry_points(self.override_entrypoint)
]
return paths
@@ -190,7 +189,7 @@ class PackagePathLoader(jinja2.BaseLoader):
"""
order_rules = []
replacement_rules = {}
- for ep in pkg_resources.iter_entry_points(self.override_entrypoint):
+ for ep in iter_entry_points(self.override_entrypoint):
for rule in getattr(ep.load(), 'template_path_rules', []):
if rule[0] == '>':
order_rules.append((ep.name, rule[1]))
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/1581f299/Allura/allura/model/auth.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/auth.py b/Allura/allura/model/auth.py
index fb58ce9..b048ce6 100644
--- a/Allura/allura/model/auth.py
+++ b/Allura/allura/model/auth.py
@@ -28,7 +28,6 @@ from hashlib import sha256
import uuid
from pytz import timezone
from datetime import timedelta, date, datetime, time
-from pkg_resources import iter_entry_points
import iso8601
import pymongo
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/1581f299/Allura/docs/extending.rst
----------------------------------------------------------------------
diff --git a/Allura/docs/extending.rst b/Allura/docs/extending.rst
index a430202..6a6abe0 100644
--- a/Allura/docs/extending.rst
+++ b/Allura/docs/extending.rst
@@ -37,7 +37,15 @@ The available extension points for Allura are:
A listing of available 3rd-party extensions is at https://sourceforge.net/p/allura/wiki/Extensions/
-Other entry points are used to provider ``paster`` commands and ``easy_widget`` configuration.
+To disable any Allura entry point, simply add an entry in your ``.ini`` config file
+with names and values corresponding to entry points defined in any ``setup.py`` file.
+For example if you have ForgeImporter set up, but want to disable the google code importers::
+
+ disable_entry_points.allura.project_importers = google-code
+ disable_entry_points.allura.importers = google-code-tracker, google-code-repo
+
+Other entry points are used to provide ``paster`` commands and ``easy_widget`` configuration,
+which are not part of Allura but are used by Allura.
Event Handlers
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/1581f299/ForgeImporters/forgeimporters/base.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/base.py b/ForgeImporters/forgeimporters/base.py
index bdff43b..7f25e69 100644
--- a/ForgeImporters/forgeimporters/base.py
+++ b/ForgeImporters/forgeimporters/base.py
@@ -20,8 +20,6 @@ import urllib
import urllib2
from collections import defaultdict
-from pkg_resources import iter_entry_points
-
from BeautifulSoup import BeautifulSoup
from tg import expose, validate, flash, redirect, config
from tg.decorators import with_trailing_slash
@@ -176,7 +174,7 @@ class ProjectImporter(BaseController):
as this project importer.
"""
tools = {}
- for ep in iter_entry_points('allura.importers'):
+ for ep in h.iter_entry_points('allura.importers'):
epv = ep.load()
if epv.source == self.source:
tools[ep.name] = epv()
@@ -289,7 +287,7 @@ class ToolImporter(object):
"""
Return a ToolImporter subclass instance given its entry-point name.
"""
- for ep in iter_entry_points('allura.importers', name):
+ for ep in h.iter_entry_points('allura.importers', name):
return ep.load()()
@staticmethod
@@ -298,7 +296,7 @@ class ToolImporter(object):
Return a ToolImporter subclass instance given its target_app class.
"""
importers = {}
- for ep in iter_entry_points('allura.importers'):
+ for ep in h.iter_entry_points('allura.importers'):
importer = ep.load()
if app in aslist(importer.target_app):
importers[ep.name] = importer()
@@ -370,7 +368,7 @@ class ProjectToolsImportController(object):
def index(self, *a, **kw):
importer_matrix = defaultdict(dict)
tools_with_importers = set()
- for ep in iter_entry_points('allura.importers'):
+ for ep in h.iter_entry_points('allura.importers'):
importer = ep.load()
for tool in aslist(importer.target_app):
tools_with_importers.add(tool.tool_label)
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/1581f299/ForgeImporters/forgeimporters/tests/test_base.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/tests/test_base.py b/ForgeImporters/forgeimporters/tests/test_base.py
index f1c93ad..92fb0cc 100644
--- a/ForgeImporters/forgeimporters/tests/test_base.py
+++ b/ForgeImporters/forgeimporters/tests/test_base.py
@@ -66,7 +66,7 @@ def ep(name, source=None, importer=None, **kw):
class TestProjectImporter(TestCase):
- @mock.patch.object(base, 'iter_entry_points')
+ @mock.patch.object(base.h, 'iter_entry_points')
def test_tool_importers(self, iep):
eps = iep.return_value = [ep('ep1', 'foo'), ep('ep2', 'bar'), ep('ep3', 'foo')]
pi = base.ProjectImporter(mock.Mock(name='neighborhood'))
@@ -100,7 +100,7 @@ class TI3(base.ToolImporter):
class TestToolImporter(TestCase):
- @mock.patch.object(base, 'iter_entry_points')
+ @mock.patch.object(base.h, 'iter_entry_points')
def test_by_name(self, iep):
eps = iep.return_value = [ep('my-name', 'my-source')]
importer = base.ToolImporter.by_name('my-name')
@@ -113,7 +113,7 @@ class TestToolImporter(TestCase):
iep.assert_called_once_with('allura.importers', 'other-name')
self.assertEqual(importer, None)
- @mock.patch.object(base, 'iter_entry_points')
+ @mock.patch.object(base.h, 'iter_entry_points')
def test_by_app(self, iep):
eps = iep.return_value = [
ep('importer1', importer=TI1),
@@ -190,7 +190,7 @@ class TestProjectToolsImportController(TestController):
def test_pages(self):
admin_page = self.app.get('/admin/')
- with mock.patch.object(base, 'iter_entry_points') as iep:
+ with mock.patch.object(base.h, 'iter_entry_points') as iep:
iep.return_value = [
ep('importer1', importer=TI1),
ep('importer2', importer=TI2),
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/1581f299/scripts/rethumb.py
----------------------------------------------------------------------
diff --git a/scripts/rethumb.py b/scripts/rethumb.py
index 5f753ff..6ee190a 100644
--- a/scripts/rethumb.py
+++ b/scripts/rethumb.py
@@ -18,14 +18,16 @@
import sys
import time
-import pkg_resources
import PIL
import tg
from pylons import tmpl_context as c
from paste.deploy.converters import asint
from ming.orm import mapper, ThreadLocalORMSession, session, state, Mapper
+
from allura.command import base
+from allura.lib.helpers import iter_entry_points
+
import forgetracker.model
@@ -109,7 +111,7 @@ class RethumbCommand(base.Command):
self.process_att_of_type(M.DiscussionAttachment, {'app_config_id': app._id, 'discussion_id': {'$ne': None}})
# Otherwise, we'll take attachment classes belonging to app's package
- ep = pkg_resources.iter_entry_points('allura', app.tool_name).next()
+ ep = iter_entry_points('allura', app.tool_name).next()
app_package = ep.module_name.split('.', 1)[0]
if app_package == 'allura':
# Apps in allura known to not define own attachment types
[21/29] git commit: [#6541] Added import_id and AuditLog to Trac
ticket importer
Posted by tv...@apache.org.
[#6541] Added import_id and AuditLog to Trac ticket importer
Signed-off-by: Cory Johns <cj...@slashdotmedia.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/4a4ee8f3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/4a4ee8f3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/4a4ee8f3
Branch: refs/heads/db/6640
Commit: 4a4ee8f37b510309d6b62c37424c97a043d37d1a
Parents: 99a09b4
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Wed Aug 28 20:32:05 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Mon Sep 9 20:27:30 2013 +0000
----------------------------------------------------------------------
.../forgeimporters/trac/tests/test_tickets.py | 16 ++++++++++++++--
ForgeImporters/forgeimporters/trac/tickets.py | 15 +++++++++++++--
2 files changed, 27 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/4a4ee8f3/ForgeImporters/forgeimporters/trac/tests/test_tickets.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/trac/tests/test_tickets.py b/ForgeImporters/forgeimporters/trac/tests/test_tickets.py
index 74e1049..2e0c199 100644
--- a/ForgeImporters/forgeimporters/trac/tests/test_tickets.py
+++ b/ForgeImporters/forgeimporters/trac/tests/test_tickets.py
@@ -19,6 +19,8 @@ import json
from unittest import TestCase
from mock import Mock, patch
+from tg import config
+
from allura.tests import TestController
from allura.tests.decorators import with_tracker
@@ -31,18 +33,21 @@ from forgeimporters.trac.tickets import (
class TestTracTicketImporter(TestCase):
@patch('forgeimporters.trac.tickets.session')
@patch('forgeimporters.trac.tickets.g')
+ @patch('forgeimporters.trac.tickets.AuditLog')
@patch('forgeimporters.trac.tickets.import_tracker')
@patch('forgeimporters.trac.tickets.AlluraImportApiClient')
@patch('forgeimporters.trac.tickets.datetime')
@patch('forgeimporters.trac.tickets.ApiTicket')
@patch('forgeimporters.trac.tickets.TracExport')
- def test_import_tool(self, TracExport, ApiTicket, dt, ApiClient, import_tracker, g, session):
+ def test_import_tool(self, TracExport, ApiTicket, dt, ApiClient, import_tracker, AuditLog, g, session):
from datetime import datetime, timedelta
now = datetime.utcnow()
dt.utcnow.return_value = now
user_map = {"orig_user":"new_user"}
importer = TracTicketImporter()
app = Mock(name='ForgeTrackerApp')
+ app.config.options.mount_point = 'bugs'
+ app.config.options.get = lambda *a: getattr(app.config.options, *a)
project = Mock(name='Project', shortname='myproject')
project.install_app.return_value = app
user = Mock(name='User', _id='id')
@@ -55,7 +60,11 @@ class TestTracTicketImporter(TestCase):
)
self.assertEqual(res, app)
project.install_app.assert_called_once_with(
- 'Tickets', mount_point='bugs', mount_label='Bugs')
+ 'Tickets', mount_point='bugs', mount_label='Bugs',
+ import_id={
+ 'source': 'Trac',
+ 'trac_url': 'http://example.com/trac/url/',
+ })
TracExport.return_value = []
TracExport.assert_called_once_with('http://example.com/trac/url/')
ApiTicket.assert_called_once_with(
@@ -67,6 +76,9 @@ class TestTracTicketImporter(TestCase):
api_client, 'myproject', 'bugs',
{"user_map": user_map}, '[]',
validate=False)
+ AuditLog.log.assert_called_once_with(
+ 'import tool bugs from http://example.com/trac/url/',
+ project=project, user=user)
g.post_event.assert_called_once_with('project_updated')
@patch('forgeimporters.trac.tickets.session')
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/4a4ee8f3/ForgeImporters/forgeimporters/trac/tickets.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/trac/tickets.py b/ForgeImporters/forgeimporters/trac/tickets.py
index 3063d71..e5238e3 100644
--- a/ForgeImporters/forgeimporters/trac/tickets.py
+++ b/ForgeImporters/forgeimporters/trac/tickets.py
@@ -43,7 +43,7 @@ from allura.lib.decorators import require_post, task
from allura.lib.import_api import AlluraImportApiClient
from allura.lib import validators as v
from allura.lib import helpers as h
-from allura.model import ApiTicket
+from allura.model import ApiTicket, AuditLog
from allura.scripts.trac_export import (
TracExport,
DateJSONEncoder,
@@ -117,7 +117,11 @@ class TracTicketImporter(ToolImporter):
'Tickets',
mount_point=mount_point,
mount_label=mount_label or 'Tickets',
- )
+ import_id={
+ 'source': self.source,
+ 'trac_url': trac_url,
+ },
+ )
session(app.config).flush(app.config)
session(app.globals).flush(app.globals)
try:
@@ -132,6 +136,13 @@ class TracTicketImporter(ToolImporter):
import_tracker(cli, project.shortname, mount_point,
{'user_map': json.loads(user_map) if user_map else {}},
export_string, validate=False)
+ AuditLog.log(
+ 'import tool %s from %s' % (
+ app.config.options.mount_point,
+ trac_url,
+ ),
+ project=project, user=user,
+ )
g.post_event('project_updated')
return app
except Exception as e:
[04/29] git commit: [#6595] Show resubmit option if snapshot not found
Posted by tv...@apache.org.
[#6595] Show resubmit option if snapshot not found
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/839e624e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/839e624e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/839e624e
Branch: refs/heads/tv/6457
Commit: 839e624ea2610a0494865e0844b706e2f8754ab4
Parents: f967955
Author: Tim Van Steenburgh <tv...@gmail.com>
Authored: Wed Aug 28 17:24:58 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Wed Aug 28 19:40:32 2013 +0000
----------------------------------------------------------------------
Allura/allura/templates/repo/tarball.html | 21 ++++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/839e624e/Allura/allura/templates/repo/tarball.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/repo/tarball.html b/Allura/allura/templates/repo/tarball.html
index 805293c..f929433 100644
--- a/Allura/allura/templates/repo/tarball.html
+++ b/Allura/allura/templates/repo/tarball.html
@@ -54,7 +54,6 @@ Commit <a href="{{commit.url()}}">{{commit.shorthand_id()}}</a> {{commit_labels(
};
var spinner = new Spinner(opts).spin($('#snapshot_status')[0]);
var delay = 500;
- // Check tarball status every 5 seconds
function check_status() {
$.get('{{commit.url()}}tarball_status?path={{path}}', function(data) {
if (data.status !== 'na') {
@@ -65,8 +64,12 @@ Commit <a href="{{commit.url()}}">{{commit.shorthand_id()}}</a> {{commit_labels(
window.location.href = '{{c.app.repo.tarball_url(revision, path)}}';
{% endif %}
} else {
- if (delay < 600000){
- delay = delay * 2
+ if (delay < 60000){
+ delay = delay * 2;
+ }
+ if (delay >= 16000) {
+ // we've been waiting at least 15 seconds
+ $('#snapshot_status form').show();
}
window.setTimeout(check_status, delay);
}
@@ -84,6 +87,11 @@ Commit <a href="{{commit.url()}}">{{commit.shorthand_id()}}</a> {{commit_labels(
<h2 class="busy">Generating snapshot...</h2>
<h2 class="ready">Your download will begin shortly, or use this <a href="{{c.app.repo.tarball_url(revision, path)}}">direct link</a>.</h2>
<h2 class="na">Checking snapshot status...</h2>
+ <form action="tarball" method="post">
+ <p>We're having trouble finding that snapshot. Would you like to resubmit?</p>
+ <input type="hidden" name="path" value="{{path}}" />
+ <input type="submit" value="Resubmit Snapshot Request" />
+ </form>
</div>
{% endblock %}
@@ -96,5 +104,12 @@ Commit <a href="{{commit.url()}}">{{commit.shorthand_id()}}</a> {{commit_labels(
#snapshot_status .{{ status }} {
display: block;
}
+ #snapshot_status form {
+ display: none;
+ margin-left: 20px;
+ }
+ #snapshot_status form p {
+ padding-left: 0;
+ }
</style>
{% endblock %}
[19/29] git commit: [#6541] Refactored import_id and ImportIdConverter
Posted by tv...@apache.org.
[#6541] Refactored import_id and ImportIdConverter
Made default import_id implementation use a dict to
record source and other info for use with multiple importers.
Requires Ming 0.3.9 (from 0.3.x branch) for MIM bug fixes for
tests to pass.
Signed-off-by: Cory Johns <cj...@slashdotmedia.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/44866429
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/44866429
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/44866429
Branch: refs/heads/db/6640
Commit: 448664290746b2c16fb99c8df1b04434f0296e37
Parents: c3d8491
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Wed Aug 28 16:31:26 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Mon Sep 9 20:27:29 2013 +0000
----------------------------------------------------------------------
Allura/allura/lib/plugin.py | 32 ++++++++++++++++++++
Allura/allura/model/artifact.py | 7 +++--
ForgeImporters/forgeimporters/google/tracker.py | 11 +++++--
.../tests/google/functional/test_tracker.py | 11 +++++--
.../forgeimporters/tests/google/test_tracker.py | 11 ++++++-
ForgeTracker/forgetracker/model/ticket.py | 2 +-
ForgeTracker/forgetracker/plugins.py | 25 ---------------
.../forgetracker/tests/functional/test_root.py | 2 +-
ForgeTracker/forgetracker/tracker_main.py | 12 +++++---
requirements-common.txt | 2 +-
10 files changed, 75 insertions(+), 40 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/44866429/Allura/allura/lib/plugin.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/plugin.py b/Allura/allura/lib/plugin.py
index f600363..3376034 100644
--- a/Allura/allura/lib/plugin.py
+++ b/Allura/allura/lib/plugin.py
@@ -947,3 +947,35 @@ class AdminExtension(object):
:rtype: ``None``
"""
pass
+
+class ImportIdConverter(object):
+ '''
+ An interface to convert to and from import_id values for indexing,
+ searching, or displaying.
+
+ To provide a new converter, expose an entry point in setup.py:
+
+ [allura.tickets.import_id_converter]
+ mysource = foo.bar:SourceIdConverter
+
+ Then in your .ini file, set tickets.import_id_converter=mysource
+ '''
+
+ @classmethod
+ def get(cls):
+ converter = config.get('import_id_converter')
+ if converter:
+ return g.entry_points['allura.import_id_converter'][converter]()
+ return cls()
+
+ def simplify(self, import_id):
+ if hasattr(import_id, 'get'):
+ return import_id.get('source_id')
+ return None
+
+ def expand(self, source_id, app_instance):
+ import_id = {
+ 'source_id': source_id,
+ }
+ import_id.update(app_instance.config.options.get('import_id', {}))
+ return import_id
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/44866429/Allura/allura/model/artifact.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/artifact.py b/Allura/allura/model/artifact.py
index 294c3d0..46c4b01 100644
--- a/Allura/allura/model/artifact.py
+++ b/Allura/allura/model/artifact.py
@@ -83,8 +83,11 @@ class Artifact(MappedClass):
references = FieldProperty(S.Deprecated)
backreferences = FieldProperty(S.Deprecated)
app_config = RelationProperty('AppConfig')
- # Not null if artifact originated from external import, then API ticket id
- import_id = FieldProperty(str, if_missing=None)
+ # Not null if artifact originated from external import. The import ID is
+ # implementation specific, but should probably be an object indicating
+ # the source, original ID, and any other info needed to identify where
+ # the artifact came from. But if you only have one source, a str might do.
+ import_id = FieldProperty(None, if_missing=None)
deleted=FieldProperty(bool, if_missing=False)
def __json__(self):
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/44866429/ForgeImporters/forgeimporters/google/tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/google/tracker.py b/ForgeImporters/forgeimporters/google/tracker.py
index eebdae0..58f28d2 100644
--- a/ForgeImporters/forgeimporters/google/tracker.py
+++ b/ForgeImporters/forgeimporters/google/tracker.py
@@ -40,11 +40,12 @@ from tg.decorators import (
from allura.controllers import BaseController
from allura.lib import helpers as h
+from allura.lib.plugin import ImportIdConverter
from allura.lib.decorators import require_post, task
from forgetracker.tracker_main import ForgeTrackerApp
from forgetracker import model as TM
-from . import GoogleCodeProjectExtractor
+from forgeimporters.google import GoogleCodeProjectExtractor
from forgeimporters.base import (
ToolImporter,
ToolImportForm,
@@ -112,11 +113,15 @@ class GoogleCodeTrackerImporter(ToolImporter):
def import_tool(self, project, user, project_name, mount_point=None,
mount_label=None, **kw):
+ import_id_converter = ImportIdConverter.get()
app = project.install_app('tickets', mount_point, mount_label,
EnableVoting=True,
open_status_names='New Accepted Started',
closed_status_names='Fixed Verified Invalid Duplicate WontFix Done',
- import_id='%s/%s/issues' % (self.source, project_name),
+ import_id={
+ 'source': self.source,
+ 'project_name': project_name,
+ },
)
ThreadLocalORMSession.flush_all()
try:
@@ -128,7 +133,7 @@ class GoogleCodeTrackerImporter(ToolImporter):
app_config_id=app.config._id,
custom_fields=dict(),
ticket_num=ticket_num,
- import_id='%s/%s' % (app.config.options.import_id, ticket_num))
+ import_id=import_id_converter.expand(ticket_num, app))
self.process_fields(ticket, issue)
self.process_labels(ticket, issue)
self.process_comments(ticket, issue)
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/44866429/ForgeImporters/forgeimporters/tests/google/functional/test_tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/tests/google/functional/test_tracker.py b/ForgeImporters/forgeimporters/tests/google/functional/test_tracker.py
index 0bd97ab..7f504a5 100644
--- a/ForgeImporters/forgeimporters/tests/google/functional/test_tracker.py
+++ b/ForgeImporters/forgeimporters/tests/google/functional/test_tracker.py
@@ -142,9 +142,16 @@ class TestGCTrackerImporter(TestCase):
def test_import_id(self):
ticket = self._make_ticket(self.test_issue, issue_id=6)
- self.assertEqual(ticket.app.config.options.import_id, 'Google Code/test-issue-project/issues')
+ self.assertEqual(ticket.app.config.options.import_id, {
+ 'source': 'Google Code',
+ 'project_name': 'test-issue-project',
+ })
self.assertEqual(ticket.ticket_num, 6)
- self.assertEqual(ticket.import_id, 'Google Code/test-issue-project/issues/6')
+ self.assertEqual(ticket.import_id, {
+ 'source': 'Google Code',
+ 'project_name': 'test-issue-project',
+ 'source_id': 6,
+ })
@skipif(module_not_available('html2text'))
def test_html2text_escaping(self):
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/44866429/ForgeImporters/forgeimporters/tests/google/test_tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/tests/google/test_tracker.py b/ForgeImporters/forgeimporters/tests/google/test_tracker.py
index d2cedc6..05b33ae 100644
--- a/ForgeImporters/forgeimporters/tests/google/test_tracker.py
+++ b/ForgeImporters/forgeimporters/tests/google/test_tracker.py
@@ -42,6 +42,12 @@ class TestTrackerImporter(TestCase):
importer.postprocess_custom_fields = mock.Mock()
project, user = mock.Mock(), mock.Mock()
app = project.install_app.return_value
+ app.config.options = {
+ 'import_id': {
+ 'source': 'Google Code',
+ 'project_name': 'project_name',
+ },
+ }
issues = gpe.iter_issues.return_value = [(50, mock.Mock()), (100, mock.Mock())]
tickets = TM.Ticket.side_effect = [mock.Mock(), mock.Mock()]
@@ -52,7 +58,10 @@ class TestTrackerImporter(TestCase):
EnableVoting=True,
open_status_names='New Accepted Started',
closed_status_names='Fixed Verified Invalid Duplicate WontFix Done',
- import_id='Google Code/project_name/issues',
+ import_id={
+ 'source': 'Google Code',
+ 'project_name': 'project_name',
+ }
)
gpe.iter_issues.assert_called_once_with('project_name')
self.assertEqual(importer.process_fields.call_args_list, [
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/44866429/ForgeTracker/forgetracker/model/ticket.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/model/ticket.py b/ForgeTracker/forgetracker/model/ticket.py
index d16039e..1d4aeb2 100644
--- a/ForgeTracker/forgetracker/model/ticket.py
+++ b/ForgeTracker/forgetracker/model/ticket.py
@@ -47,9 +47,9 @@ from allura.lib import security
from allura.lib.search import search_artifact, SearchError
from allura.lib import utils
from allura.lib import helpers as h
+from allura.lib.plugin import ImportIdConverter
from allura.tasks import mail_tasks
-from forgetracker.plugins import ImportIdConverter
log = logging.getLogger(__name__)
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/44866429/ForgeTracker/forgetracker/plugins.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/plugins.py b/ForgeTracker/forgetracker/plugins.py
index a32dcfc..3afbca2 100644
--- a/ForgeTracker/forgetracker/plugins.py
+++ b/ForgeTracker/forgetracker/plugins.py
@@ -22,28 +22,3 @@ from pylons import app_globals as g
log = logging.getLogger(__name__)
-
-class ImportIdConverter(object):
- '''
- An interface to provide authentication services for Allura.
-
- To provide a new converter, expose an entry point in setup.py:
-
- [allura.tickets.import_id_converter]
- mylegacy = foo.bar:LegacyConverter
-
- Then in your .ini file, set tickets.import_id_converter=mylegacy
- '''
-
- @classmethod
- def get(cls):
- converter = config.get('tickets.import_id_converter')
- if converter:
- return g.entry_points['allura.tickets.import_id_converter'][converter]()
- return cls()
-
- def simplify(self, import_id):
- return import_id
-
- def expand(self, url_part, app_instance):
- return url_part
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/44866429/ForgeTracker/forgetracker/tests/functional/test_root.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tests/functional/test_root.py b/ForgeTracker/forgetracker/tests/functional/test_root.py
index 0ba4f0b..86ef522 100644
--- a/ForgeTracker/forgetracker/tests/functional/test_root.py
+++ b/ForgeTracker/forgetracker/tests/functional/test_root.py
@@ -1573,7 +1573,7 @@ class TestFunctionalController(TrackerTestController):
def test_imported_tickets_redirect(self):
self.new_ticket(summary='Imported ticket')
ticket = tm.Ticket.query.get(ticket_num=1)
- ticket.import_id = '42000'
+ ticket.import_id = {'source_id': '42000'}
ThreadLocalORMSession.flush_all()
# expect permanent redirect to /p/test/bugs/1/
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/44866429/ForgeTracker/forgetracker/tracker_main.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tracker_main.py b/ForgeTracker/forgetracker/tracker_main.py
index 8aa29f6..3afdb15 100644
--- a/ForgeTracker/forgetracker/tracker_main.py
+++ b/ForgeTracker/forgetracker/tracker_main.py
@@ -58,6 +58,7 @@ from allura.lib import validators as V
from allura.lib.widgets import form_fields as ffw
from allura.lib.widgets.subscriptions import SubscribeForm
from allura.lib.zarkov_helpers import zero_fill_zarkov_result
+from allura.lib.plugin import ImportIdConverter
from allura.controllers import AppDiscussionController, AppDiscussionRestController
from allura.controllers import attachments as ac
from allura.controllers import BaseController
@@ -75,7 +76,6 @@ from forgetracker.widgets.bin_form import BinForm
from forgetracker.widgets.ticket_search import TicketSearchResults, MassEdit, MassEditForm, MassMoveForm, SearchHelp
from forgetracker.widgets.admin_custom_fields import TrackerFieldAdmin, TrackerFieldDisplay
from forgetracker.import_support import ImportSupport
-from forgetracker.plugins import ImportIdConverter
log = logging.getLogger(__name__)
@@ -1196,11 +1196,15 @@ class TicketController(BaseController, FeedController):
self.ticket = TM.Ticket.query.get(app_config_id=c.app.config._id,
ticket_num=self.ticket_num)
if self.ticket is None:
- self.ticket = TM.Ticket.query.get(
- app_config_id=c.app.config._id,
- import_id=str(ImportIdConverter.get().expand(ticket_num, c.app)))
+ query = {'app_config_id': c.app.config._id}
+ import_id = ImportIdConverter.get().expand(ticket_num, c.app)
+ if import_id:
+ query.update({'import_id.%s' % k: v for k,v in import_id.iteritems()})
+ self.ticket = TM.Ticket.query.get(**query)
if self.ticket is not None:
utils.permanent_redirect(self.ticket.url())
+ else:
+ raise exc.HTTPNotFound('Ticket #%s does not exist.' % ticket_num)
self.attachment = AttachmentsController(self.ticket)
# self.comments = CommentController(self.ticket)
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/44866429/requirements-common.txt
----------------------------------------------------------------------
diff --git a/requirements-common.txt b/requirements-common.txt
index 5e261a0..5e4d6cc 100644
--- a/requirements-common.txt
+++ b/requirements-common.txt
@@ -21,7 +21,7 @@ httplib2==0.7.4
iso8601==0.1.4
Jinja2==2.6
Markdown==2.2.0
-Ming==0.3.7
+Ming==0.3.9
oauth2==1.5.170
# tg2 dep PasteDeploy must specified before TurboGears2, to avoid a version/allow-hosts problem
Paste==1.7.5.1
[25/29] git commit: [#6541] Added audit log on project import
Posted by tv...@apache.org.
[#6541] Added audit log on project import
Signed-off-by: Cory Johns <cj...@slashdotmedia.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/99a09b45
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/99a09b45
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/99a09b45
Branch: refs/heads/db/6640
Commit: 99a09b45530617a4668b3f296bc599dda4eb1536
Parents: ad81824
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Wed Aug 28 20:19:13 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Mon Sep 9 20:27:30 2013 +0000
----------------------------------------------------------------------
ForgeImporters/forgeimporters/base.py | 2 ++
.../forgeimporters/tests/test_base.py | 24 ++++++++++++++++++++
2 files changed, 26 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/99a09b45/ForgeImporters/forgeimporters/base.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/base.py b/ForgeImporters/forgeimporters/base.py
index e0e9d6f..ffb1650 100644
--- a/ForgeImporters/forgeimporters/base.py
+++ b/ForgeImporters/forgeimporters/base.py
@@ -37,6 +37,7 @@ from allura.lib import helpers as h
from allura.lib import exceptions
from allura.lib import validators as v
from allura.app import SitemapEntry
+from allura import model as M
from paste.deploy.converters import aslist
@@ -245,6 +246,7 @@ class ProjectImporter(BaseController):
self.after_project_create(c.project, **kw)
for importer_name in kw['tools']:
import_tool.post(importer_name, **kw)
+ M.AuditLog.log('import project from %s' % self.source)
flash('Welcome to the %s Project System! '
'Your project data will be imported and should show up here shortly.' % config['site_name'])
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/99a09b45/ForgeImporters/forgeimporters/tests/test_base.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/tests/test_base.py b/ForgeImporters/forgeimporters/tests/test_base.py
index 7de0625..4aefc35 100644
--- a/ForgeImporters/forgeimporters/tests/test_base.py
+++ b/ForgeImporters/forgeimporters/tests/test_base.py
@@ -99,6 +99,30 @@ class TestProjectImporter(TestCase):
self.assertEqual(pi.tool_importers, {'ep1': eps[0].lv, 'ep3': eps[2].lv})
iep.assert_called_once_with('allura.importers')
+ @mock.patch.object(base, 'redirect')
+ @mock.patch.object(base, 'flash')
+ @mock.patch.object(base, 'import_tool')
+ @mock.patch.object(base, 'M')
+ @mock.patch.object(base, 'c')
+ def test_process(self, c, M, import_tool, flash, redirect):
+ pi = base.ProjectImporter(mock.Mock())
+ pi.source = 'Source'
+ pi.after_project_create = mock.Mock()
+ pi.neighborhood.register_project.return_value.script_name = 'script_name/'
+ kw = {
+ 'project_name': 'project_name',
+ 'project_shortname': 'shortname',
+ 'tools': ['tool'],
+ }
+ with mock.patch.dict(base.config, {'site_name': 'foo'}):
+ pi.process(**kw)
+ pi.neighborhood.register_project.assert_called_once_with('shortname', project_name='project_name')
+ pi.after_project_create.assert_called_once_with(c.project, **kw)
+ import_tool.post.assert_called_once_with('tool', **kw)
+ M.AuditLog.log.assert_called_once_with('import project from Source')
+ self.assertEqual(flash.call_count, 1)
+ redirect.assert_called_once_with('script_name/admin/overview')
+
TA1 = mock.Mock(tool_label='foo', tool_description='foo_desc')
[27/29] git commit: [#6541] bump trac & GC wiki importers,
for their audit log addition
Posted by tv...@apache.org.
[#6541] bump trac & GC wiki importers, for their audit log addition
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/815ef4fb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/815ef4fb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/815ef4fb
Branch: refs/heads/db/6640
Commit: 815ef4fbf2d0021f6263b39f3943ecbbbc9c9cd4
Parents: 89cfb5a
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Mon Sep 9 20:29:00 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Mon Sep 9 20:29:00 2013 +0000
----------------------------------------------------------------------
requirements-sf.txt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/815ef4fb/requirements-sf.txt
----------------------------------------------------------------------
diff --git a/requirements-sf.txt b/requirements-sf.txt
index 286c95a..ecad4a2 100644
--- a/requirements-sf.txt
+++ b/requirements-sf.txt
@@ -6,7 +6,7 @@ kombu==1.0.4
coverage==3.5a1-20110413
ForgeHg==0.1.16
ForgePastebin==0.2.7
-GoogleCodeWikiImporter==0.3.1
+GoogleCodeWikiImporter==0.3.3
mechanize==0.2.4
mercurial==1.4.3
MySQL-python==1.2.3c1
@@ -20,7 +20,7 @@ wsgipreload==1.2
pyzmq==2.1.7
html2text==3.200.3dev-20121112
PyMollom==0.1
-TracWikiImporter==0.2.1
+TracWikiImporter==0.2.2
# use version built from https://github.com/johnsca/GitPython/commits/tv/6000
# for unmerged fixes for [#5411], [#6000], and [#6078]
[17/29] git commit: [#6457] Save result of mount_point validation
Posted by tv...@apache.org.
[#6457] Save result of mount_point validation
- Allows validator to return an alternate mount_point if the one
passed in is already in use.
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/b959450d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/b959450d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/b959450d
Branch: refs/heads/tv/6457
Commit: b959450d9fda99b2dfe22099c188bde85bd06e31
Parents: e795553
Author: Tim Van Steenburgh <tv...@gmail.com>
Authored: Wed Aug 28 16:56:26 2013 +0000
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Tue Sep 3 14:46:51 2013 +0000
----------------------------------------------------------------------
ForgeImporters/forgeimporters/google/code.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/b959450d/ForgeImporters/forgeimporters/google/code.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/google/code.py b/ForgeImporters/forgeimporters/google/code.py
index 60a0158..ed2519f 100644
--- a/ForgeImporters/forgeimporters/google/code.py
+++ b/ForgeImporters/forgeimporters/google/code.py
@@ -109,7 +109,7 @@ class GoogleRepoImportForm(fe.schema.Schema):
raise
tool_class = REPO_APPS[repo_type]
try:
- v.MountPointValidator(tool_class).to_python(mount_point)
+ value['mount_point'] = v.MountPointValidator(tool_class).to_python(mount_point)
except fe.Invalid as e:
raise fe.Invalid('mount_point:' + str(e), value, state)
return value
[18/29] git commit: Merge branch 'tv/6457' of
https://git-wip-us.apache.org/repos/asf/incubator-allura into tv/6457
Posted by tv...@apache.org.
Merge branch 'tv/6457' of https://git-wip-us.apache.org/repos/asf/incubator-allura into tv/6457
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/22e76662
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/22e76662
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/22e76662
Branch: refs/heads/tv/6457
Commit: 22e766626e0204ac8b955dd6df55cca1f9819975
Parents: b959450 04851fa
Author: Tim Van Steenburgh <tv...@gmail.com>
Authored: Tue Sep 3 14:47:11 2013 +0000
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Tue Sep 3 14:47:11 2013 +0000
----------------------------------------------------------------------
----------------------------------------------------------------------
[14/29] git commit: [#5775] ticket:404 looking for renames in git log
Posted by tv...@apache.org.
[#5775] ticket:404 looking for renames in git log
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/24093750
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/24093750
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/24093750
Branch: refs/heads/tv/6457
Commit: 240937501856ba885850bad591fefcae0f6cb124
Parents: 2d81595
Author: Anton Kasyanov <mi...@gmail.com>
Authored: Tue Aug 6 13:50:24 2013 +0300
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Thu Aug 29 19:00:45 2013 +0000
----------------------------------------------------------------------
ForgeGit/forgegit/model/git_repo.py | 49 ++++++++++++++++++--------------
1 file changed, 27 insertions(+), 22 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/24093750/ForgeGit/forgegit/model/git_repo.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/model/git_repo.py b/ForgeGit/forgegit/model/git_repo.py
index ade299e..1599fd2 100644
--- a/ForgeGit/forgegit/model/git_repo.py
+++ b/ForgeGit/forgegit/model/git_repo.py
@@ -301,28 +301,22 @@ class GitImplementation(M.RepositoryImplementation):
path = path.strip('/') if path else None
if exclude is not None:
revs.extend(['^%s' % e for e in exclude])
- for ci, refs in self._iter_commits_with_refs([revs, '--', path]):
+ args = ['--name-status', revs, '--', path]
+ if path:
+ args = ['--follow'] + args
+ for ci, refs, renamed in self._iter_commits_with_refs(*args):
if id_only:
yield ci.hexsha
else:
size = None
- renamed_from = {}
+ rename_details = {}
if path:
- # checking for renaming in this commit
- if ci.parents:
- # without create_path=True, renames are not detected
- # see diff() doc from git/diff.py
- diff_with_parent = ci.diff(
- ci.parents[0],
- create_patch=True
- )[0]
- # since we do diff with previous commit (not next)
- # rename_from and rename_to are interchanged
- if diff_with_parent.renamed and diff_with_parent.rename_from == path:
- renamed_from['path'] = '/' + diff_with_parent.rename_to
- renamed_from['commit_url'] = self._repo.url_for_commit(
- ci.hexsha
- )
+ if renamed and renamed['to'] == path:
+ rename_details['path'] = '/' + renamed['from']
+ rename_details['commit_url'] = self._repo.url_for_commit(
+ ci.hexsha
+ )
+
try:
node = ci.tree/path
size = node.size if node.type == 'blob' else None
@@ -344,8 +338,11 @@ class GitImplementation(M.RepositoryImplementation):
'refs': refs,
'parents': [pci.hexsha for pci in ci.parents],
'size': size,
- 'renamed_from': renamed_from,
+ 'renamed_from': rename_details,
}
+ if rename_details:
+ # we do not need to show commits before rename
+ break
def _iter_commits_with_refs(self, *args, **kwargs):
"""
@@ -369,12 +366,20 @@ class GitImplementation(M.RepositoryImplementation):
proc = self._git.git.log(*args, format='%H%x00%d', as_process=True, **kwargs)
stream = proc.stdout
while True:
- line = stream.readline()
- if not line:
+ commit_lines = [stream.readline() for _ in xrange(3)]
+ commit_line = '\x00'.join(
+ [line.strip('\n ').replace('\t', ' ') for line in commit_lines if line.strip('\n\t ')]
+ )
+ if not commit_line:
break
- hexsha, decoration = line.strip().split('\x00')
+ hexsha, decoration, name_stat = commit_line.strip().split('\x00')
refs = decoration.strip(' ()').split(', ') if decoration else []
- yield (git.Commit(self._git, gitdb.util.hex_to_bin(hexsha)), refs)
+ name_stat_parts = name_stat.split(' ')
+ renamed = {}
+ if name_stat_parts[0] == 'R100':
+ renamed['from'] = name_stat_parts[1]
+ renamed['to'] = name_stat_parts[2]
+ yield (git.Commit(self._git, gitdb.util.hex_to_bin(hexsha)), refs, renamed)
def open_blob(self, blob):
return _OpenedGitBlob(
[29/29] git commit: Merge branch 'db/6640' of
https://git-wip-us.apache.org/repos/asf/incubator-allura into db/6640
Posted by tv...@apache.org.
Merge branch 'db/6640' of https://git-wip-us.apache.org/repos/asf/incubator-allura into db/6640
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/4eb88f5b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/4eb88f5b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/4eb88f5b
Branch: refs/heads/db/6640
Commit: 4eb88f5b6cc6dfbcfab2d6955f6dd8656555e015
Parents: 6e4fe74 f3d3166
Author: Tim Van Steenburgh <tv...@gmail.com>
Authored: Tue Sep 10 12:53:26 2013 +0000
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Tue Sep 10 12:53:26 2013 +0000
----------------------------------------------------------------------
----------------------------------------------------------------------
[20/29] git commit: [#6541] Added import_id for GC tracker importer
Posted by tv...@apache.org.
[#6541] Added import_id for GC tracker importer
Signed-off-by: Cory Johns <cj...@slashdotmedia.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/c3d8491e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/c3d8491e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/c3d8491e
Branch: refs/heads/db/6640
Commit: c3d8491eaca5562414ae42a4fd2819b671920b6d
Parents: f190769
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Mon Aug 26 21:48:36 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Mon Sep 9 20:27:29 2013 +0000
----------------------------------------------------------------------
ForgeImporters/forgeimporters/google/tracker.py | 4 +++-
.../forgeimporters/tests/google/functional/test_tracker.py | 6 ++++++
ForgeImporters/forgeimporters/tests/google/test_tracker.py | 1 +
3 files changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c3d8491e/ForgeImporters/forgeimporters/google/tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/google/tracker.py b/ForgeImporters/forgeimporters/google/tracker.py
index 40dd939..eebdae0 100644
--- a/ForgeImporters/forgeimporters/google/tracker.py
+++ b/ForgeImporters/forgeimporters/google/tracker.py
@@ -116,6 +116,7 @@ class GoogleCodeTrackerImporter(ToolImporter):
EnableVoting=True,
open_status_names='New Accepted Started',
closed_status_names='Fixed Verified Invalid Duplicate WontFix Done',
+ import_id='%s/%s/issues' % (self.source, project_name),
)
ThreadLocalORMSession.flush_all()
try:
@@ -126,7 +127,8 @@ class GoogleCodeTrackerImporter(ToolImporter):
ticket = TM.Ticket(
app_config_id=app.config._id,
custom_fields=dict(),
- ticket_num=ticket_num)
+ ticket_num=ticket_num,
+ import_id='%s/%s' % (app.config.options.import_id, ticket_num))
self.process_fields(ticket, issue)
self.process_labels(ticket, issue)
self.process_comments(ticket, issue)
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c3d8491e/ForgeImporters/forgeimporters/tests/google/functional/test_tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/tests/google/functional/test_tracker.py b/ForgeImporters/forgeimporters/tests/google/functional/test_tracker.py
index 24081d9..0bd97ab 100644
--- a/ForgeImporters/forgeimporters/tests/google/functional/test_tracker.py
+++ b/ForgeImporters/forgeimporters/tests/google/functional/test_tracker.py
@@ -140,6 +140,12 @@ class TestGCTrackerImporter(TestCase):
self.assertEqual(ticket.votes_up, 1)
self.assertEqual(ticket.votes, 1)
+ def test_import_id(self):
+ ticket = self._make_ticket(self.test_issue, issue_id=6)
+ self.assertEqual(ticket.app.config.options.import_id, 'Google Code/test-issue-project/issues')
+ self.assertEqual(ticket.ticket_num, 6)
+ self.assertEqual(ticket.import_id, 'Google Code/test-issue-project/issues/6')
+
@skipif(module_not_available('html2text'))
def test_html2text_escaping(self):
ticket = self._make_ticket(self.test_issue)
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c3d8491e/ForgeImporters/forgeimporters/tests/google/test_tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/tests/google/test_tracker.py b/ForgeImporters/forgeimporters/tests/google/test_tracker.py
index 5bbf836..d2cedc6 100644
--- a/ForgeImporters/forgeimporters/tests/google/test_tracker.py
+++ b/ForgeImporters/forgeimporters/tests/google/test_tracker.py
@@ -52,6 +52,7 @@ class TestTrackerImporter(TestCase):
EnableVoting=True,
open_status_names='New Accepted Started',
closed_status_names='Fixed Verified Invalid Duplicate WontFix Done',
+ import_id='Google Code/project_name/issues',
)
gpe.iter_issues.assert_called_once_with('project_name')
self.assertEqual(importer.process_fields.call_args_list, [
[11/29] git commit: [#5775] ticket:405 adding rename detection to svn
Posted by tv...@apache.org.
[#5775] ticket:405 adding rename detection to svn
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/de91d9d7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/de91d9d7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/de91d9d7
Branch: refs/heads/tv/6457
Commit: de91d9d74f1c0702f7e798c321d8b437bae86d84
Parents: 9a5ec88
Author: Anton Kasyanov <mi...@gmail.com>
Authored: Thu Aug 8 17:05:20 2013 +0300
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Thu Aug 29 19:00:45 2013 +0000
----------------------------------------------------------------------
ForgeSVN/forgesvn/model/svn.py | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/de91d9d7/ForgeSVN/forgesvn/model/svn.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/model/svn.py b/ForgeSVN/forgesvn/model/svn.py
index 9074946..3e6ea25 100644
--- a/ForgeSVN/forgesvn/model/svn.py
+++ b/ForgeSVN/forgesvn/model/svn.py
@@ -533,28 +533,39 @@ class SVNImplementation(M.RepositoryImplementation):
while revno > exclude:
rev = pysvn.Revision(pysvn.opt_revision_kind.number, revno)
try:
- logs = self._svn.log(url, revision_start=rev, limit=page_size)
+ logs = self._svn.log(url, revision_start=rev, limit=page_size,
+ discover_changed_paths=True)
except pysvn.ClientError as e:
if 'Unable to connect' in e.message:
raise # repo error
return # no (more) history for this path
for ci in logs:
+
if ci.revision.number <= exclude:
return
if id_only:
yield ci.revision.number
else:
- yield self._map_log(ci, url)
+ yield self._map_log(ci, url, path)
if len(logs) < page_size:
return # we didn't get a full page, don't bother calling SVN again
revno = ci.revision.number - 1
- def _map_log(self, ci, url):
+ def _map_log(self, ci, url, path=None):
revno = ci.revision.number
try:
size = int(self._svn.list(url)[0][0].size)
- except pysvn.ClientError as e:
+ except pysvn.ClientError:
size = None
+ rename_details = {}
+ changed_paths = ci.get('changed_paths', [])
+ for changed_path in changed_paths:
+ if changed_path['copyfrom_path'] and changed_path['path'] == path and changed_path['action'] == 'A':
+ rename_details['path'] = changed_path['copyfrom_path']
+ rename_details['commit_url'] = self._repo.url_for_commit(
+ changed_path['copyfrom_revision'].number
+ )
+ break
return {
'id': revno,
'message': h.really_unicode(ci.get('message', '--none--')),
@@ -571,6 +582,7 @@ class SVNImplementation(M.RepositoryImplementation):
'refs': ['HEAD'] if revno == self.head else [],
'parents': [revno-1] if revno > 1 else [],
'size': size,
+ 'rename_details': rename_details,
}
def open_blob(self, blob):
[12/29] git commit: [#5775] ticket:404 using diff.renamed now
Posted by tv...@apache.org.
[#5775] ticket:404 using diff.renamed now
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/2d81595e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/2d81595e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/2d81595e
Branch: refs/heads/tv/6457
Commit: 2d81595ecc43f7f7ec4398cc79e8d6fa74bdc49e
Parents: a6dccae
Author: Anton Kasyanov <mi...@gmail.com>
Authored: Tue Aug 6 12:40:36 2013 +0300
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Thu Aug 29 19:00:45 2013 +0000
----------------------------------------------------------------------
ForgeGit/forgegit/model/git_repo.py | 41 +++++++++-----------------------
1 file changed, 11 insertions(+), 30 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/2d81595e/ForgeGit/forgegit/model/git_repo.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/model/git_repo.py b/ForgeGit/forgegit/model/git_repo.py
index fc7be67..ade299e 100644
--- a/ForgeGit/forgegit/model/git_repo.py
+++ b/ForgeGit/forgegit/model/git_repo.py
@@ -301,10 +301,7 @@ class GitImplementation(M.RepositoryImplementation):
path = path.strip('/') if path else None
if exclude is not None:
revs.extend(['^%s' % e for e in exclude])
- args = [revs, '--', path]
- if path:
- args.append('--follow')
- for ci, refs in self._iter_commits_with_refs(*args):
+ for ci, refs in self._iter_commits_with_refs([revs, '--', path]):
if id_only:
yield ci.hexsha
else:
@@ -312,29 +309,17 @@ class GitImplementation(M.RepositoryImplementation):
renamed_from = {}
if path:
# checking for renaming in this commit
- # log is called with follow, so there should be all commits
- # even before renaming
if ci.parents:
- diffs_with_parent = ci.diff(ci.parents[0])
- deleted_file_diffs = []
- renamed = False
- for diff in diffs_with_parent:
- if not diff.b_mode and not diff.b_blob:
- #new file was created
- if diff.a_blob.name == os.path.basename(path):
- renamed = True
- if not diff.a_mode and not diff.a_blob:
- #file was deleted
- deleted_file_diffs.append(diff)
- if renamed:
- if len(deleted_file_diffs) > 1:
- log.info('Couldn\'t find if file was renamed: too many deletions')
- elif len(deleted_file_diffs) == 1:
- deleted_diff = deleted_file_diffs[0]
- renamed_from['path'] = '{}/{}'.format(
- os.path.dirname(path),
- deleted_diff.b_blob.name,
- )
+ # without create_path=True, renames are not detected
+ # see diff() doc from git/diff.py
+ diff_with_parent = ci.diff(
+ ci.parents[0],
+ create_patch=True
+ )[0]
+ # since we do diff with previous commit (not next)
+ # rename_from and rename_to are interchanged
+ if diff_with_parent.renamed and diff_with_parent.rename_from == path:
+ renamed_from['path'] = '/' + diff_with_parent.rename_to
renamed_from['commit_url'] = self._repo.url_for_commit(
ci.hexsha
)
@@ -361,10 +346,6 @@ class GitImplementation(M.RepositoryImplementation):
'size': size,
'renamed_from': renamed_from,
}
- if renamed_from:
- # if file was renamed, do not yield commits
- # before renaming
- break
def _iter_commits_with_refs(self, *args, **kwargs):
"""