incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [08/36] PEP8 cleanup
Date Fri, 10 Jan 2014 21:23:04 GMT
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c93733ac/ForgeLink/setup.py
----------------------------------------------------------------------
diff --git a/ForgeLink/setup.py b/ForgeLink/setup.py
index 1379ac2..711d2c1 100644
--- a/ForgeLink/setup.py
+++ b/ForgeLink/setup.py
@@ -16,7 +16,8 @@
 #       under the License.
 
 from setuptools import setup, find_packages
-import sys, os
+import sys
+import os
 
 from forgelink.version import __version__
 
@@ -25,7 +26,8 @@ setup(name='ForgeLink',
       description="",
       long_description="""\
 """,
-      classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
+      # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
+      classifiers=[],
       keywords='',
       author='',
       author_email='',

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c93733ac/ForgeSVN/forgesvn/controllers.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/controllers.py b/ForgeSVN/forgesvn/controllers.py
index 44d1a69..f4461f0 100644
--- a/ForgeSVN/forgesvn/controllers.py
+++ b/ForgeSVN/forgesvn/controllers.py
@@ -38,9 +38,9 @@ class BranchBrowser(repository.BranchBrowser, FeedController):
         latest = c.app.repo.latest(branch=self._branch)
         if is_empty or not latest:
             return dict(allow_fork=False, log=[], is_empty=is_empty)
-        redirect(c.app.repo.url_for_commit(c.app.default_branch_name) + 'tree/')
+        redirect(c.app.repo.url_for_commit(c.app.default_branch_name)
+                 + 'tree/')
 
     @expose()
     def _lookup(self, rev, *remainder):
         return repository.CommitBrowser(rev), remainder
-

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c93733ac/ForgeSVN/forgesvn/model/svn.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/model/svn.py b/ForgeSVN/forgesvn/model/svn.py
index b55c397..9823f1e 100644
--- a/ForgeSVN/forgesvn/model/svn.py
+++ b/ForgeSVN/forgesvn/model/svn.py
@@ -46,13 +46,15 @@ from allura.model.repository import zipdir
 
 log = logging.getLogger(__name__)
 
+
 class Repository(M.Repository):
-    tool_name='SVN'
-    repo_id='svn'
-    type_s='SVN Repository'
+    tool_name = 'SVN'
+    repo_id = 'svn'
+    type_s = 'SVN Repository'
+
     class __mongometa__:
-        name='svn-repository'
-    branches = FieldProperty([dict(name=str,object_id=str)])
+        name = 'svn-repository'
+    branches = FieldProperty([dict(name=str, object_id=str)])
     _refresh_precompute = False
 
     @LazyProperty
@@ -68,13 +70,17 @@ class Repository(M.Repository):
         tpl = string.Template(tg.config.get('scm.clone.%s.%s' % (category, self.tool)) or
                               tg.config.get('scm.clone.%s' % self.tool))
         return tpl.substitute(dict(username=username,
-                                   source_url=self.clone_url(category, username)+c.app.config.options.get('checkout_url'),
+                                   source_url=self.clone_url(
+                                       category, username) + c.app.config.options.get(
+                                       'checkout_url'),
                                    dest_path=self.suggested_clone_dest_path()))
 
-    def compute_diffs(self): return
+    def compute_diffs(self):
+        return
 
     def latest(self, branch=None):
-        if self._impl is None: return None
+        if self._impl is None:
+            return None
         return self._impl.commit('HEAD')
 
     def tarball_filename(self, revision, path=None):
@@ -88,6 +94,7 @@ class Repository(M.Repository):
 
 
 class SVNCalledProcessError(Exception):
+
     def __init__(self, cmd, returncode, stdout, stderr):
         self.cmd = cmd
         self.returncode = returncode
@@ -113,7 +120,9 @@ def svn_path_exists(path, rev=None):
 
 
 class SVNLibWrapper(object):
+
     """Wrapper around pysvn, used for instrumentation."""
+
     def __init__(self, client):
         self.client = client
 
@@ -185,10 +194,10 @@ class SVNImplementation(M.RepositoryImplementation):
         if os.path.exists(fullname):
             shutil.rmtree(fullname)
         subprocess.call(['svnadmin', 'create', self._repo.name],
-                                 stdin=subprocess.PIPE,
-                                 stdout=subprocess.PIPE,
-                                 stderr=subprocess.PIPE,
-                                 cwd=self._repo.fs_path)
+                        stdin=subprocess.PIPE,
+                        stdout=subprocess.PIPE,
+                        stderr=subprocess.PIPE,
+                        cwd=self._repo.fs_path)
         if not skip_special_files:
             self._setup_special_files()
         self._repo.set_status('ready')
@@ -197,17 +206,18 @@ class SVNImplementation(M.RepositoryImplementation):
             tmp_working_dir = tempfile.mkdtemp(prefix='allura-svn-r1-',
                                                dir=tg.config.get('scm.svn.tmpdir', g.tmpdir))
             log.info('tmp dir = %s', tmp_working_dir)
-            self._repo._impl._svn.checkout('file://'+fullname, tmp_working_dir)
-            os.mkdir(tmp_working_dir+'/trunk')
-            os.mkdir(tmp_working_dir+'/tags')
-            os.mkdir(tmp_working_dir+'/branches')
-            self._repo._impl._svn.add(tmp_working_dir+'/trunk')
-            self._repo._impl._svn.add(tmp_working_dir+'/tags')
-            self._repo._impl._svn.add(tmp_working_dir+'/branches')
-            self._repo._impl._svn.checkin([tmp_working_dir+'/trunk',
-                                           tmp_working_dir+'/tags',
-                                           tmp_working_dir+'/branches'],
-                                        'Initial commit')
+            self._repo._impl._svn.checkout(
+                'file://' + fullname, tmp_working_dir)
+            os.mkdir(tmp_working_dir + '/trunk')
+            os.mkdir(tmp_working_dir + '/tags')
+            os.mkdir(tmp_working_dir + '/branches')
+            self._repo._impl._svn.add(tmp_working_dir + '/trunk')
+            self._repo._impl._svn.add(tmp_working_dir + '/tags')
+            self._repo._impl._svn.add(tmp_working_dir + '/branches')
+            self._repo._impl._svn.checkin([tmp_working_dir + '/trunk',
+                                           tmp_working_dir + '/tags',
+                                           tmp_working_dir + '/branches'],
+                                          'Initial commit')
             shutil.rmtree(tmp_working_dir)
             log.info('deleted %s', tmp_working_dir)
 
@@ -261,13 +271,15 @@ class SVNImplementation(M.RepositoryImplementation):
             # make sure new repo has a pre-revprop-change hook,
             # otherwise the sync will fail
             set_hook('pre-revprop-change')
-            self.check_call(['svnsync', '--non-interactive', '--allow-non-empty',
-              'initialize', self._url, source_url])
+            self.check_call(
+                ['svnsync', '--non-interactive', '--allow-non-empty',
+                 'initialize', self._url, source_url])
             clear_hook('pre-revprop-change')
         else:
             set_hook('pre-revprop-change')
             self.check_call(['svnsync', 'init', self._url, source_url])
-            self.check_call(['svnsync', '--non-interactive', 'sync', self._url])
+            self.check_call(
+                ['svnsync', '--non-interactive', 'sync', self._url])
             clear_hook('pre-revprop-change')
 
         log.info('... %r cloned', self._repo)
@@ -287,12 +299,13 @@ class SVNImplementation(M.RepositoryImplementation):
         """
         opts = self._repo.app.config.options
         if not svn_path_exists('file://{0}{1}/{2}'.format(self._repo.fs_path,
-                self._repo.name, opts['checkout_url'])):
+                                                          self._repo.name, opts['checkout_url'])):
             opts['checkout_url'] = ''
 
         if (not opts['checkout_url'] and
-                svn_path_exists('file://{0}{1}/trunk'.format(self._repo.fs_path,
-                    self._repo.name))):
+                svn_path_exists(
+                    'file://{0}{1}/trunk'.format(self._repo.fs_path,
+                                                 self._repo.name))):
             opts['checkout_url'] = 'trunk'
 
     def commit(self, rev):
@@ -319,7 +332,7 @@ class SVNImplementation(M.RepositoryImplementation):
 
     def new_commits(self, all_commits=False):
         head_revno = self.head
-        oids = [ self._oid(revno) for revno in range(1, head_revno+1) ]
+        oids = [self._oid(revno) for revno in range(1, head_revno + 1)]
         if all_commits:
             return oids
         # Find max commit id -- everything greater than that will be "unknown"
@@ -327,22 +340,24 @@ class SVNImplementation(M.RepositoryImplementation):
         q = M.repo.Commit.query.find(
             dict(
                 type='commit',
-                _id={'$gt':prefix},
-                ),
+                _id={'$gt': prefix},
+            ),
             dict(_id=True)
-            )
+        )
         seen_oids = set()
         for d in q.ming_cursor.cursor:
             oid = d['_id']
-            if not oid.startswith(prefix): break
+            if not oid.startswith(prefix):
+                break
             seen_oids.add(oid)
         return [
-            oid for oid in oids if oid not in seen_oids ]
+            oid for oid in oids if oid not in seen_oids]
 
     def refresh_commit_info(self, oid, seen_object_ids, lazy=True):
         from allura.model.repo import CommitDoc, DiffInfoDoc
         ci_doc = CommitDoc.m.get(_id=oid)
-        if ci_doc and lazy: return False
+        if ci_doc and lazy:
+            return False
         revno = self._revno(oid)
         rev = self._revision(oid)
         try:
@@ -352,7 +367,8 @@ class SVNImplementation(M.RepositoryImplementation):
                 limit=1,
                 discover_changed_paths=True)[0]
         except pysvn.ClientError:
-            log.info('ClientError processing %r %r, treating as empty', oid, self._repo, exc_info=True)
+            log.info('ClientError processing %r %r, treating as empty',
+                     oid, self._repo, exc_info=True)
             log_entry = Object(date='', message='', changed_paths=[])
         log_date = None
         if hasattr(log_entry, 'date'):
@@ -360,7 +376,7 @@ class SVNImplementation(M.RepositoryImplementation):
         user = Object(
             name=h.really_unicode(log_entry.get('author', '--none--')),
             email='',
-           date=log_date)
+            date=log_date)
         args = dict(
             tree_id=None,
             committed=user,
@@ -369,7 +385,7 @@ class SVNImplementation(M.RepositoryImplementation):
             parent_ids=[],
             child_ids=[])
         if revno > 1:
-            args['parent_ids'] = [ self._oid(revno-1) ]
+            args['parent_ids'] = [self._oid(revno - 1)]
         if ci_doc:
             ci_doc.update(**args)
             ci_doc.m.save()
@@ -378,7 +394,8 @@ class SVNImplementation(M.RepositoryImplementation):
             try:
                 ci_doc.m.insert(safe=True)
             except DuplicateKeyError:
-                if lazy: return False
+                if lazy:
+                    return False
         # Save diff info
         di = DiffInfoDoc.make(dict(_id=ci_doc._id, differences=[]))
         for path in log_entry.changed_paths:
@@ -417,21 +434,22 @@ class SVNImplementation(M.RepositoryImplementation):
             else:
                 lhs_id = None
             di.differences.append(dict(
-                    name=h.really_unicode(path.path),
-                    lhs_id=lhs_id,
-                    rhs_id=rhs_id))
+                name=h.really_unicode(path.path),
+                lhs_id=lhs_id,
+                rhs_id=rhs_id))
         di.m.save()
         return True
 
     def compute_tree_new(self, commit, tree_path='/'):
         from allura.model import repo as RM
-        tree_path = '/' + tree_path.strip('/')  # always leading slash, never trailing
+        # always leading slash, never trailing
+        tree_path = '/' + tree_path.strip('/')
         tree_id = self._tree_oid(commit._id, tree_path)
         tree = RM.Tree.query.get(_id=tree_id)
         if tree:
             return tree_id
         log.debug('Computing tree for %s: %s',
-                 self._revno(commit._id), tree_path)
+                  self._revno(commit._id), tree_path)
         rev = self._revision(commit._id)
         try:
             infos = self._svn.info2(
@@ -449,34 +467,35 @@ class SVNImplementation(M.RepositoryImplementation):
         for path, info in infos[1:]:
             if info.kind == pysvn.node_kind.dir:
                 tree_ids.append(Object(
-                        id=self._tree_oid(commit._id, path),
-                        name=path))
+                    id=self._tree_oid(commit._id, path),
+                    name=path))
             elif info.kind == pysvn.node_kind.file:
                 blob_ids.append(Object(
-                        id=self._tree_oid(commit._id, path),
-                        name=path))
+                    id=self._tree_oid(commit._id, path),
+                    name=path))
             else:
                 assert False
             lcd_entries.append(dict(
-                    name=path,
-                    commit_id=self._oid(info.last_changed_rev.number),
-                ))
+                name=path,
+                commit_id=self._oid(info.last_changed_rev.number),
+            ))
         tree, is_new = RM.Tree.upsert(tree_id,
-                tree_ids=tree_ids,
-                blob_ids=blob_ids,
-                other_ids=[],
-            )
+                                      tree_ids=tree_ids,
+                                      blob_ids=blob_ids,
+                                      other_ids=[],
+                                      )
         if is_new:
             commit_id = self._oid(infos[0][1].last_changed_rev.number)
             path = tree_path.strip('/')
             RM.TreesDoc.m.update_partial(
-                    {'_id': commit._id},
-                    {'$addToSet': {'tree_ids': tree_id}},
-                    upsert=True)
+                {'_id': commit._id},
+                {'$addToSet': {'tree_ids': tree_id}},
+                upsert=True)
             RM.LastCommitDoc.m.update_partial(
-                    {'commit_id': commit_id, 'path': path},
-                    {'commit_id': commit_id, 'path': path, 'entries': lcd_entries},
-                    upsert=True)
+                {'commit_id': commit_id, 'path': path},
+                {'commit_id': commit_id, 'path':
+                 path, 'entries': lcd_entries},
+                upsert=True)
         return tree_id
 
     def _tree_oid(self, commit_id, path):
@@ -533,7 +552,8 @@ 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, peg_revision=rev, limit=page_size,
+                logs = self._svn.log(
+                    url, revision_start=rev, peg_revision=rev, limit=page_size,
                     discover_changed_paths=True)
             except pysvn.ClientError as e:
                 if 'Unable to connect' in e.message:
@@ -548,16 +568,18 @@ class SVNImplementation(M.RepositoryImplementation):
                 else:
                     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
+                # we didn't get a full page, don't bother calling SVN again
+                return
             revno = ci.revision.number - 1
 
     def _check_changed_path(self, changed_path, path):
         if (changed_path['copyfrom_path'] and
-                    changed_path['path'] and
-                    path and
-                    (len(changed_path['path']) < len(path)) and
-                    path.startswith(changed_path['path'])):
-                changed_path['copyfrom_path'] = changed_path['copyfrom_path'] + path[len(changed_path['path']):]
+                changed_path['path'] and
+                path and
+                (len(changed_path['path']) < len(path)) and
+                path.startswith(changed_path['path'])):
+                changed_path['copyfrom_path'] = changed_path['copyfrom_path'] + \
+                    path[len(changed_path['path']):]
                 changed_path['path'] = path
         return changed_path
 
@@ -565,7 +587,8 @@ class SVNImplementation(M.RepositoryImplementation):
         revno = ci.revision.number
         rev = pysvn.Revision(pysvn.opt_revision_kind.number, revno)
         try:
-            size = int(self._svn.list(url, revision=rev, peg_revision=rev)[0][0].size)
+            size = int(
+                self._svn.list(url, revision=rev, peg_revision=rev)[0][0].size)
         except pysvn.ClientError:
             size = None
         rename_details = {}
@@ -579,23 +602,23 @@ class SVNImplementation(M.RepositoryImplementation):
                 )
                 break
         return {
-                'id': revno,
-                'message': h.really_unicode(ci.get('message', '--none--')),
-                'authored': {
-                        'name': h.really_unicode(ci.get('author', '--none--')),
-                        'email': '',
-                        'date': datetime.utcfromtimestamp(ci.date),
-                    },
-                'committed': {
-                        'name': h.really_unicode(ci.get('author', '--none--')),
-                        'email': '',
-                        'date': datetime.utcfromtimestamp(ci.date),
-                    },
-                'refs': ['HEAD'] if revno == self.head else [],
-                'parents': [revno-1] if revno > 1 else [],
-                'size': size,
-                'rename_details': rename_details,
-            }
+            'id': revno,
+            'message': h.really_unicode(ci.get('message', '--none--')),
+            'authored': {
+                'name': h.really_unicode(ci.get('author', '--none--')),
+                'email': '',
+                'date': datetime.utcfromtimestamp(ci.date),
+            },
+            'committed': {
+                'name': h.really_unicode(ci.get('author', '--none--')),
+                'email': '',
+                'date': datetime.utcfromtimestamp(ci.date),
+            },
+            '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):
         data = self._svn.cat(
@@ -607,18 +630,21 @@ class SVNImplementation(M.RepositoryImplementation):
         try:
             rev = self._revision(blob.commit._id)
             data = self._svn.list(
-                   self._url + blob.path(),
-                   revision=rev,
-                   peg_revision=rev,
-                   dirent_fields=pysvn.SVN_DIRENT_SIZE)
+                self._url + blob.path(),
+                revision=rev,
+                peg_revision=rev,
+                dirent_fields=pysvn.SVN_DIRENT_SIZE)
         except pysvn.ClientError:
-            log.info('ClientError getting filesize %r %r, returning 0', blob.path(), self._repo, exc_info=True)
+            log.info('ClientError getting filesize %r %r, returning 0',
+                     blob.path(), self._repo, exc_info=True)
             return 0
 
         try:
             size = data[0][0]['size']
         except (IndexError, KeyError):
-            log.info('Error getting filesize: bad data from svn client %r %r, returning 0', blob.path(), self._repo, exc_info=True)
+            log.info(
+                'Error getting filesize: bad data from svn client %r %r, returning 0',
+                blob.path(), self._repo, exc_info=True)
             size = 0
 
         return size
@@ -629,7 +655,8 @@ class SVNImplementation(M.RepositoryImplementation):
         # the hook should also call the user-defined post-commit-user hook
         text = self.post_receive_template.substitute(
             url=self._repo.refresh_url())
-        fn = os.path.join(self._repo.fs_path, self._repo.name, 'hooks', 'post-commit')
+        fn = os.path.join(self._repo.fs_path, self._repo.name,
+                          'hooks', 'post-commit')
         with open(fn, 'wb') as fp:
             fp.write(text)
         os.chmod(fn, 0755)
@@ -661,7 +688,8 @@ class SVNImplementation(M.RepositoryImplementation):
         if len(paths) == 1:
             tree_path = '/' + os.path.dirname(paths[0].strip('/'))
         else:
-            tree_path = '/' + os.path.commonprefix(paths).strip('/')  # always leading slash, never trailing
+            # always leading slash, never trailing
+            tree_path = '/' + os.path.commonprefix(paths).strip('/')
         paths = [path.strip('/') for path in paths]
         rev = self._revision(commit._id)
         try:
@@ -689,7 +717,8 @@ class SVNImplementation(M.RepositoryImplementation):
                 limit=1,
                 discover_changed_paths=True)[0]
         except pysvn.ClientError:
-            log.info('ClientError processing %r %r, treating as empty', oid, self._repo, exc_info=True)
+            log.info('ClientError processing %r %r, treating as empty',
+                     oid, self._repo, exc_info=True)
             log_entry = Object(date='', message='', changed_paths=[])
         return [p.path for p in log_entry.changed_paths]
 
@@ -702,7 +731,8 @@ class SVNImplementation(M.RepositoryImplementation):
                 idx = path.index('tags')
             elif 'branches' in path:
                 idx = path.index('branches')
-            if idx is not None and idx < len(path) - 1:  # e.g. path/tags/tag-1.0/...
+            # e.g. path/tags/tag-1.0/...
+            if idx is not None and idx < len(path) - 1:
                 return '/'.join(path[:idx + 2])  # path/tags/tag-1.0
             if 'trunk' in path:
                 idx = path.index('trunk')
@@ -720,8 +750,10 @@ class SVNImplementation(M.RepositoryImplementation):
             os.makedirs(self._repo.tarball_path)
         archive_name = self._repo.tarball_filename(commit, path)
         dest = os.path.join(self._repo.tarball_path, archive_name)
-        filename = os.path.join(self._repo.tarball_path, '%s%s' % (archive_name, '.zip'))
-        tmpfilename = os.path.join(self._repo.tarball_path, '%s%s' % (archive_name, '.tmp'))
+        filename = os.path.join(self._repo.tarball_path, '%s%s' %
+                                (archive_name, '.zip'))
+        tmpfilename = os.path.join(self._repo.tarball_path, '%s%s' %
+                                   (archive_name, '.tmp'))
         rmtree(dest, ignore_errors=True)
         path = os.path.join(self._url, path)
         try:
@@ -730,7 +762,8 @@ class SVNImplementation(M.RepositoryImplementation):
             locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')
             self._svn.export(path,
                              dest,
-                             revision=pysvn.Revision(pysvn.opt_revision_kind.number, commit),
+                             revision=pysvn.Revision(
+                                 pysvn.opt_revision_kind.number, commit),
                              ignore_externals=True)
             zipdir(dest, tmpfilename)
             os.rename(tmpfilename, filename)
@@ -744,9 +777,11 @@ class SVNImplementation(M.RepositoryImplementation):
 
     def is_file(self, path, rev=None):
         url = '/'.join([self._url, path.strip('/')])
-        rev = pysvn.Revision(pysvn.opt_revision_kind.number, self._revno(self.rev_parse(rev)))
+        rev = pysvn.Revision(pysvn.opt_revision_kind.number,
+                             self._revno(self.rev_parse(rev)))
         try:
-            info = self._svn.list(url, revision=rev, peg_revision=rev, dirent_fields=pysvn.SVN_DIRENT_KIND)[0][0]
+            info = self._svn.list(
+                url, revision=rev, peg_revision=rev, dirent_fields=pysvn.SVN_DIRENT_KIND)[0][0]
             return info.kind == pysvn.node_kind.file
         except pysvn.ClientError:
             return False

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c93733ac/ForgeSVN/forgesvn/svn_main.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/svn_main.py b/ForgeSVN/forgesvn/svn_main.py
index bee61b3..dd72214 100644
--- a/ForgeSVN/forgesvn/svn_main.py
+++ b/ForgeSVN/forgesvn/svn_main.py
@@ -45,23 +45,25 @@ from .model.svn import svn_path_exists
 
 log = logging.getLogger(__name__)
 
+
 class ForgeSVNApp(RepositoryApp):
+
     '''This is the SVN app for PyForge'''
     __version__ = version.__version__
     config_options = RepositoryApp.config_options + [
         ConfigOption('checkout_url', str, '')
-        ]
+    ]
     permissions_desc = dict(RepositoryApp.permissions_desc, **{
         'write': 'Repo commit access.',
         'admin': 'Set permissions, checkout url, and viewable files. Import a remote repo.',
     })
-    tool_label='SVN'
-    tool_description="""
+    tool_label = 'SVN'
+    tool_description = """
         Enterprise-class centralized version control for the masses.
     """
-    ordinal=4
-    forkable=False
-    default_branch_name='HEAD'
+    ordinal = 4
+    forkable = False
+    default_branch_name = 'HEAD'
 
     def __init__(self, project, config):
         super(ForgeSVNApp, self).__init__(project, config)
@@ -99,16 +101,20 @@ class ForgeSVNApp(RepositoryApp):
     def admin_menu(self):
         links = []
         links.append(SitemapEntry(
-                'Checkout URL',
-                c.project.url()+'admin/'+self.config.options.mount_point+'/' + 'checkout_url',
-                className='admin_modal'))
+            'Checkout URL',
+            c.project.url() + 'admin/' +
+            self.config.options.mount_point +
+            '/' + 'checkout_url',
+            className='admin_modal'))
         links.append(SitemapEntry(
-                'Import Repo',
-                c.project.url()+'admin/'+self.config.options.mount_point+'/' + 'importer/'))
+            'Import Repo',
+            c.project.url() + 'admin/' + self.config.options.mount_point + '/' + 'importer/'))
         links += super(ForgeSVNApp, self).admin_menu()
         return links
 
+
 class SVNRepoAdminController(RepoAdminController):
+
     def __init__(self, app):
         super(SVNRepoAdminController, self).__init__(app)
         self.importer = SVNImportController(self.app)
@@ -131,11 +137,12 @@ class SVNRepoAdminController(RepoAdminController):
             self.app.config.options['checkout_url'] = post_data['checkout_url']
             flash("Checkout URL successfully changed")
         else:
-            flash("%s is not a valid path for this repository" % post_data['checkout_url'], "error")
+            flash("%s is not a valid path for this repository" %
+                  post_data['checkout_url'], "error")
 
 
 class SVNImportController(BaseController):
-    import_form=widgets.ImportForm()
+    import_form = widgets.ImportForm()
 
     def __init__(self, app):
         self.app = app
@@ -154,8 +161,8 @@ class SVNImportController(BaseController):
     def do_import(self, checkout_url=None, **kwargs):
         if self.app.repo.is_empty():
             with h.push_context(
-                self.app.config.project_id,
-                app_config_id=self.app.config._id):
+                    self.app.config.project_id,
+                    app_config_id=self.app.config._id):
                 allura.tasks.repo_tasks.reclone.post(
                     cloned_from_path=None,
                     cloned_from_name=None,
@@ -172,8 +179,9 @@ class SVNImportController(BaseController):
 
 
 def svn_timers():
-    return Timer('svn_lib.{method_name}', SM.svn.SVNLibWrapper, 'checkout', 'add',
-                 'checkin', 'info2', 'log', 'cat', 'list')
+    return Timer(
+        'svn_lib.{method_name}', SM.svn.SVNLibWrapper, 'checkout', 'add',
+        'checkin', 'info2', 'log', 'cat', 'list')
 
 
 def forgesvn_timers():

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c93733ac/ForgeSVN/forgesvn/tests/__init__.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/__init__.py b/ForgeSVN/forgesvn/tests/__init__.py
index 8ee62fd..d152a9e 100644
--- a/ForgeSVN/forgesvn/tests/__init__.py
+++ b/ForgeSVN/forgesvn/tests/__init__.py
@@ -18,7 +18,7 @@
 #       under the License.
 
 
-## Make our own SVN tool test decorator
+# Make our own SVN tool test decorator
 from allura.tests.decorators import with_tool
 
 with_svn = with_tool('test', 'SVN', 'src', 'SVN')

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c93733ac/ForgeSVN/forgesvn/tests/functional/test_auth.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/functional/test_auth.py b/ForgeSVN/forgesvn/tests/functional/test_auth.py
index 178c8f0..7394c1b 100644
--- a/ForgeSVN/forgesvn/tests/functional/test_auth.py
+++ b/ForgeSVN/forgesvn/tests/functional/test_auth.py
@@ -23,6 +23,7 @@ from datadiff.tools import assert_equal
 from allura.tests import TestController
 from forgesvn.tests import with_svn
 
+
 class TestSVNAuth(TestController):
 
     @with_svn
@@ -40,7 +41,9 @@ class TestSVNAuth(TestController):
         assert_equal(r.body, 'Cannot find repo at /p/test/blah')
 
         r = self.app.get('/auth/refresh_repo/p/test/src/')
-        assert_equal(r.body, '<Repository /tmp/svn/p/test/src> refresh queued.\n')
+        assert_equal(r.body,
+                     '<Repository /tmp/svn/p/test/src> refresh queued.\n')
+
 
 class TestSVNUserPermissions(TestController):
     allow = dict(allow_read=True, allow_write=True, allow_create=True)
@@ -49,7 +52,8 @@ class TestSVNUserPermissions(TestController):
 
     @with_svn
     def test_list_repos(self):
-        r = self.app.get('/auth/repo_permissions', params=dict(username='test-admin'), status=200)
+        r = self.app.get('/auth/repo_permissions',
+                         params=dict(username='test-admin'), status=200)
         assert_equal(json.loads(r.body), {"allow_write": [
             '/svn/test/src',
         ]})

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c93733ac/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 2cc0b9c..ca02196 100644
--- a/ForgeSVN/forgesvn/tests/functional/test_controllers.py
+++ b/ForgeSVN/forgesvn/tests/functional/test_controllers.py
@@ -33,7 +33,9 @@ from alluratest.controller import TestController
 from forgesvn.tests import with_svn
 from allura.tests.decorators import with_tool
 
+
 class SVNTestController(TestController):
+
     def setUp(self):
         TestController.setUp(self)
         self.setup_with_tools()
@@ -95,7 +97,7 @@ class TestRootController(SVNTestController):
 
     def test_commit_browser_data(self):
         resp = self.app.get('/src/commit_browser_data')
-        data = json.loads(resp.body);
+        data = json.loads(resp.body)
         assert data['max_row'] == 5
         assert data['next_column'] == 1
         for val in data['built_tree'].values():
@@ -112,7 +114,8 @@ class TestRootController(SVNTestController):
             title = channel.find('title').text
             assert_equal(title, 'test SVN changes')
             description = channel.find('description').text
-            assert_equal(description, 'Recent changes to SVN repository in test project')
+            assert_equal(description,
+                         'Recent changes to SVN repository in test project')
             link = channel.find('link').text
             assert_equal(link, 'http://localhost/p/test/src/')
             commit = channel.find('item')
@@ -144,8 +147,10 @@ class TestRootController(SVNTestController):
 
     def test_file(self):
         resp = self.app.get('/src/1/tree/README')
-        assert 'README' in resp.html.find('h2', {'class':'dark title'}).contents[2]
-        content = str(resp.html.find('div', {'class':'clip grid-19 codebrowser'}))
+        assert 'README' in resp.html.find(
+            'h2', {'class': 'dark title'}).contents[2]
+        content = str(
+            resp.html.find('div', {'class': 'clip grid-19 codebrowser'}))
         assert 'This is readme' in content, content
         assert '<span id="l1" class="code_block">' in resp
         assert 'var hash = window.location.hash.substring(1);' in resp
@@ -233,30 +238,37 @@ class TestRootController(SVNTestController):
         form = r.html.find('form', 'tarball')
         assert_equal(form.button.text, 'Download Snapshot')
         assert_equal(form.get('action'), '/p/test/svn-tags/19/tarball')
-        assert_equal(form.find('input', attrs=dict(name='path')).get('value'), '/tags/tag-1.0')
+        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')
+        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')).follow()
+        r = self.app.post('/p/test/svn-tags/19/tarball',
+                          dict(path='/tags/tag-1.0')).follow()
         assert 'Generating snapshot...' in r
         M.MonQTask.run_ready()
-        r = self.app.get('/p/test/svn-tags/19/tarball_status?path=/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'], 'complete')
 
         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/')).follow()
+        r = self.app.post('/p/test/svn-tags/19/tarball',
+                          dict(path='/trunk/')).follow()
         assert 'Generating snapshot...' in r
         M.MonQTask.run_ready()
         r = self.app.get('/p/test/svn-tags/19/tarball_status?path=/trunk')
         assert_equal(r.json['status'], 'complete')
 
-        r = self.app.get('/p/test/svn-tags/19/tarball_status?path=/branches/aaa/')
+        r = self.app.get(
+            '/p/test/svn-tags/19/tarball_status?path=/branches/aaa/')
         assert_equal(r.json['status'], None)
 
         # All of the following also should be ready because...
         # ...this is essentially the same as trunk snapshot
-        r = self.app.get('/p/test/svn-tags/19/tarball_status?path=/trunk/some/path/')
+        r = self.app.get(
+            '/p/test/svn-tags/19/tarball_status?path=/trunk/some/path/')
         assert_equal(r.json['status'], 'complete')
         r = self.app.get('/p/test/svn-tags/19/tarball_status')
         assert_equal(r.json['status'], 'complete')
@@ -267,7 +279,8 @@ class TestRootController(SVNTestController):
         r = self.app.get('/p/test/svn-tags/19/tarball_status?path=/branches/')
         assert_equal(r.json['status'], 'complete')
         # ...this is essentially the same as tag snapshot
-        r = self.app.get('/p/test/svn-tags/19/tarball_status?path=/tags/tag-1.0/dir')
+        r = self.app.get(
+            '/p/test/svn-tags/19/tarball_status?path=/tags/tag-1.0/dir')
         assert_equal(r.json['status'], 'complete')
 
 
@@ -297,6 +310,7 @@ class TestImportController(SVNTestController):
 
 
 class SVNTestRenames(TestController):
+
     def setUp(self):
         TestController.setUp(self)
         self.setup_with_tools()

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c93733ac/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 9990bdb..babafb3 100644
--- a/ForgeSVN/forgesvn/tests/model/test_repository.py
+++ b/ForgeSVN/forgesvn/tests/model/test_repository.py
@@ -47,6 +47,7 @@ from forgesvn.model.svn import svn_path_exists
 from forgesvn.tests import with_svn
 from allura.tests.decorators import with_tool
 
+
 class TestNewRepo(unittest.TestCase):
 
     def setUp(self):
@@ -62,9 +63,9 @@ class TestNewRepo(unittest.TestCase):
         self.repo = SM.Repository(
             name='testsvn',
             fs_path=repo_dir,
-            url_path = '/test/',
-            tool = 'svn',
-            status = 'creating')
+            url_path='/test/',
+            tool='svn',
+            status='creating')
         self.repo.refresh()
         self.rev = self.repo.commit('HEAD')
         ThreadLocalORMSession.flush_all()
@@ -96,7 +97,8 @@ class TestNewRepo(unittest.TestCase):
         self.rev.tree.by_name['README']
         assert self.rev.tree.is_blob('README') == True
         assert self.rev.tree['a']['b']['c'].ls() == []
-        self.assertRaises(KeyError, lambda:self.rev.tree['a']['b']['d'])
+        self.assertRaises(KeyError, lambda: self.rev.tree['a']['b']['d'])
+
 
 class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
 
@@ -114,16 +116,16 @@ class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
         self.repo = SM.Repository(
             name='testsvn',
             fs_path=repo_dir,
-            url_path = '/test/',
-            tool = 'svn',
-            status = 'creating')
+            url_path='/test/',
+            tool='svn',
+            status='creating')
         self.repo.refresh()
         self.svn_tags = SM.Repository(
             name='testsvn-trunk-tags-branches',
             fs_path=repo_dir,
-            url_path = '/test/',
-            tool = 'svn',
-            status = 'creating')
+            url_path='/test/',
+            tool='svn',
+            status='creating')
         self.svn_tags.refresh()
         ThreadLocalORMSession.flush_all()
         ThreadLocalORMSession.close_all()
@@ -131,10 +133,10 @@ class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
     def test_init(self):
         repo = SM.Repository(
             name='testsvn',
-            fs_path=g.tmpdir+'/',
-            url_path = '/test/',
-            tool = 'svn',
-            status = 'creating')
+            fs_path=g.tmpdir + '/',
+            url_path='/test/',
+            tool='svn',
+            status='creating')
         dirname = os.path.join(repo.fs_path, repo.name)
         if os.path.exists(dirname):
             shutil.rmtree(dirname)
@@ -144,10 +146,10 @@ class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
     def test_fork(self):
         repo = SM.Repository(
             name='testsvn',
-            fs_path=g.tmpdir+'/',
-            url_path = '/test/',
-            tool = 'svn',
-            status = 'creating')
+            fs_path=g.tmpdir + '/',
+            url_path='/test/',
+            tool='svn',
+            status='creating')
         repo_path = pkg_resources.resource_filename(
             'forgesvn', 'tests/data/testsvn')
         dirname = os.path.join(repo.fs_path, repo.name)
@@ -155,12 +157,16 @@ class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
             shutil.rmtree(dirname)
         repo.init()
         repo._impl.clone_from('file://' + repo_path)
-        assert not os.path.exists(os.path.join(g.tmpdir, 'testsvn/hooks/pre-revprop-change'))
-        assert os.path.exists(os.path.join(g.tmpdir, 'testsvn/hooks/post-commit'))
-        assert os.access(os.path.join(g.tmpdir, 'testsvn/hooks/post-commit'), os.X_OK)
+        assert not os.path.exists(
+            os.path.join(g.tmpdir, 'testsvn/hooks/pre-revprop-change'))
+        assert os.path.exists(
+            os.path.join(g.tmpdir, 'testsvn/hooks/post-commit'))
+        assert os.access(
+            os.path.join(g.tmpdir, 'testsvn/hooks/post-commit'), os.X_OK)
         with open(os.path.join(g.tmpdir, 'testsvn/hooks/post-commit')) as f:
             c = f.read()
-        self.assertIn('curl -s http://localhost/auth/refresh_repo/p/test/src/\n', c)
+        self.assertIn(
+            'curl -s http://localhost/auth/refresh_repo/p/test/src/\n', c)
         self.assertIn('exec $DIR/post-commit-user "$@"\n', c)
 
         repo.refresh(notify=False)
@@ -182,8 +188,8 @@ class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
             stdout = combo[2]
             obj.check_call.return_value = stdout, ''
             expected = (source_url.startswith('file://') and
-                    tg.config['scm.svn.hotcopy'] and
-                    stdout != 'version 1.6')
+                        tg.config['scm.svn.hotcopy'] and
+                        stdout != 'version 1.6')
             result = func(obj, source_url)
             assert result == expected
 
@@ -191,10 +197,10 @@ class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
     def test_clone(self, post_event):
         repo = SM.Repository(
             name='testsvn',
-            fs_path=g.tmpdir+'/',
-            url_path = '/test/',
-            tool = 'svn',
-            status = 'creating')
+            fs_path=g.tmpdir + '/',
+            url_path='/test/',
+            tool='svn',
+            status='creating')
         repo_path = pkg_resources.resource_filename(
             'forgesvn', 'tests/data/testsvn')
         dirname = os.path.join(repo.fs_path, repo.name)
@@ -202,12 +208,16 @@ class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
             shutil.rmtree(dirname)
         repo.init()
         repo._impl.clone_from('file://' + repo_path)
-        assert not os.path.exists(os.path.join(g.tmpdir, 'testsvn/hooks/pre-revprop-change'))
-        assert os.path.exists(os.path.join(g.tmpdir, 'testsvn/hooks/post-commit'))
-        assert os.access(os.path.join(g.tmpdir, 'testsvn/hooks/post-commit'), os.X_OK)
+        assert not os.path.exists(
+            os.path.join(g.tmpdir, 'testsvn/hooks/pre-revprop-change'))
+        assert os.path.exists(
+            os.path.join(g.tmpdir, 'testsvn/hooks/post-commit'))
+        assert os.access(
+            os.path.join(g.tmpdir, 'testsvn/hooks/post-commit'), os.X_OK)
         with open(os.path.join(g.tmpdir, 'testsvn/hooks/post-commit')) as f:
             c = f.read()
-        self.assertIn('curl -s http://localhost/auth/refresh_repo/p/test/src/\n', c)
+        self.assertIn(
+            'curl -s http://localhost/auth/refresh_repo/p/test/src/\n', c)
         self.assertIn('exec $DIR/post-commit-user "$@"\n', c)
 
         repo.refresh(notify=False)
@@ -277,9 +287,9 @@ class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
              'rename_details': {},
              'id': 3,
              'authored':
-                 {'date': datetime(2010, 10, 8, 15, 32, 48, 272296),
-                  'name': u'rick446',
-                  'email': ''},
+             {'date': datetime(2010, 10, 8, 15, 32, 48, 272296),
+              'name': u'rick446',
+              'email': ''},
              'size': 0},
             {'parents': [1],
              'refs': [],
@@ -337,7 +347,7 @@ class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
              'refs': [],
              'size': 15,
              'rename_details': {}},
-            ])
+        ])
 
     def test_is_file(self):
         assert self.repo.is_file('/README')
@@ -348,9 +358,9 @@ class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
         self.assertEqual(entry.diffs, entry.paged_diffs())
         self.assertEqual(entry.diffs, entry.paged_diffs(start=0))
         added_expected = entry.diffs.added[1:3]
-        expected =  dict(
-                copied=[], changed=[], removed=[],
-                added=added_expected, total=4)
+        expected = dict(
+            copied=[], changed=[], removed=[],
+            added=added_expected, total=4)
         actual = entry.paged_diffs(start=1, end=3)
         self.assertEqual(expected, actual)
 
@@ -411,20 +421,26 @@ class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
         with mock.patch('forgesvn.model.svn.pysvn') as pysvn:
             svn_path_exists('dummy')
             pysvn.Client.return_value.info2.assert_called_once_with(
-                    'dummy',
-                    revision=pysvn.Revision.return_value,
-                    recurse=False)
+                'dummy',
+                revision=pysvn.Revision.return_value,
+                recurse=False)
 
     @onlyif(os.path.exists(tg.config.get('scm.repos.tarball.zip_binary', '/usr/bin/zip')), 'zip binary is missing')
     def test_tarball(self):
         tmpdir = tg.config['scm.repos.tarball.root']
-        assert_equal(self.repo.tarball_path, os.path.join(tmpdir, 'svn/t/te/test/testsvn'))
-        assert_equal(self.repo.tarball_url('1'), 'file:///svn/t/te/test/testsvn/test-src-1.zip')
+        assert_equal(self.repo.tarball_path,
+                     os.path.join(tmpdir, 'svn/t/te/test/testsvn'))
+        assert_equal(self.repo.tarball_url('1'),
+                     'file:///svn/t/te/test/testsvn/test-src-1.zip')
         self.repo.tarball('1')
-        assert os.path.isfile(os.path.join(tmpdir, "svn/t/te/test/testsvn/test-src-1.zip"))
-        tarball_zip = ZipFile(os.path.join(tmpdir, 'svn/t/te/test/testsvn/test-src-1.zip'), 'r')
-        assert_equal(tarball_zip.namelist(), ['test-src-1/', 'test-src-1/README'])
-        shutil.rmtree(self.repo.tarball_path.encode('utf-8'), ignore_errors=True)
+        assert os.path.isfile(
+            os.path.join(tmpdir, "svn/t/te/test/testsvn/test-src-1.zip"))
+        tarball_zip = ZipFile(
+            os.path.join(tmpdir, 'svn/t/te/test/testsvn/test-src-1.zip'), 'r')
+        assert_equal(tarball_zip.namelist(),
+                     ['test-src-1/', 'test-src-1/README'])
+        shutil.rmtree(self.repo.tarball_path.encode('utf-8'),
+                      ignore_errors=True)
 
     @onlyif(os.path.exists(tg.config.get('scm.repos.tarball.zip_binary', '/usr/bin/zip')), 'zip binary is missing')
     def test_tarball_aware_of_tags(self):
@@ -434,7 +450,8 @@ class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
                               'test-svn-tags-19-tags-tag-1.0/README'])
         h.set_context('test', 'svn-tags', neighborhood='Projects')
         tmpdir = tg.config['scm.repos.tarball.root']
-        tarball_path = os.path.join(tmpdir, 'svn/t/te/test/testsvn-trunk-tags-branches/')
+        tarball_path = os.path.join(
+            tmpdir, 'svn/t/te/test/testsvn-trunk-tags-branches/')
         fn = tarball_path + 'test-svn-tags-19-tags-tag-1.0.zip'
         self.svn_tags.tarball(rev, '/tags/tag-1.0/')
         assert os.path.isfile(fn), fn
@@ -469,7 +486,8 @@ class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
                                  'test-svn-tags-19-branches-aaa/README'])
         h.set_context('test', 'svn-tags', neighborhood='Projects')
         tmpdir = tg.config['scm.repos.tarball.root']
-        tarball_path = os.path.join(tmpdir, 'svn/t/te/test/testsvn-trunk-tags-branches/')
+        tarball_path = os.path.join(
+            tmpdir, 'svn/t/te/test/testsvn-trunk-tags-branches/')
         fn = tarball_path + 'test-svn-tags-19-branches-aaa.zip'
         self.svn_tags.tarball(rev, '/branches/aaa/')
         assert os.path.isfile(fn), fn
@@ -505,7 +523,8 @@ class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
                                 'test-svn-tags-19-trunk/README'])
         h.set_context('test', 'svn-tags', neighborhood='Projects')
         tmpdir = tg.config['scm.repos.tarball.root']
-        tarball_path = os.path.join(tmpdir, 'svn/t/te/test/testsvn-trunk-tags-branches/')
+        tarball_path = os.path.join(
+            tmpdir, 'svn/t/te/test/testsvn-trunk-tags-branches/')
         fn = tarball_path + 'test-svn-tags-19-trunk.zip'
         self.svn_tags.tarball(rev, '/trunk/')
         assert os.path.isfile(fn), fn
@@ -532,7 +551,8 @@ class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
         assert os.path.isfile(fn), fn
         snapshot = ZipFile(fn, 'r')
         assert_equal(snapshot.namelist(), ['test-src-1/', 'test-src-1/README'])
-        shutil.rmtree(os.path.join(tmpdir, 'svn/t/te/test/testsvn/'), ignore_errors=True)
+        shutil.rmtree(os.path.join(tmpdir, 'svn/t/te/test/testsvn/'),
+                      ignore_errors=True)
         shutil.rmtree(tarball_path, ignore_errors=True)
 
     def test_is_empty(self):
@@ -541,15 +561,16 @@ class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
             repo2 = SM.Repository(
                 name='test',
                 fs_path=d.path,
-                url_path = '/test/',
-                tool = 'svn',
-                status = 'creating')
+                url_path='/test/',
+                tool='svn',
+                status='creating')
             repo2.init()
             assert repo2.is_empty()
             repo2.refresh()
             ThreadLocalORMSession.flush_all()
             assert repo2.is_empty()
 
+
 class TestSVNRev(unittest.TestCase):
 
     def setUp(self):
@@ -565,9 +586,9 @@ class TestSVNRev(unittest.TestCase):
         self.repo = SM.Repository(
             name='testsvn',
             fs_path=repo_dir,
-            url_path = '/test/',
-            tool = 'svn',
-            status = 'creating')
+            url_path='/test/',
+            tool='svn',
+            status='creating')
         self.repo.refresh()
         self.rev = self.repo.commit(1)
         ThreadLocalORMSession.flush_all()
@@ -584,9 +605,9 @@ class TestSVNRev(unittest.TestCase):
 
     def test_diff(self):
         diffs = (self.rev.diffs.added
-                 +self.rev.diffs.removed
-                 +self.rev.diffs.changed
-                 +self.rev.diffs.copied)
+                 + self.rev.diffs.removed
+                 + self.rev.diffs.changed
+                 + self.rev.diffs.copied)
         for d in diffs:
             print d
 
@@ -605,7 +626,8 @@ class TestSVNRev(unittest.TestCase):
         assert_equal(commits, [4, 2])
         commits = list(self.repo.log(3, 'a/b/c/', id_only=True))
         assert_equal(commits, [2])
-        assert_equal(list(self.repo.log(self.repo.head, 'does/not/exist', id_only=True)), [])
+        assert_equal(
+            list(self.repo.log(self.repo.head, 'does/not/exist', id_only=True)), [])
 
     def test_notification_email(self):
         setup_global_objects()
@@ -615,9 +637,9 @@ class TestSVNRev(unittest.TestCase):
         self.repo = SM.Repository(
             name='testsvn',
             fs_path=repo_dir,
-            url_path = '/test/',
-            tool = 'svn',
-            status = 'creating')
+            url_path='/test/',
+            tool='svn',
+            status='creating')
         self.repo.refresh()
         ThreadLocalORMSession.flush_all()
         send_notifications(self.repo, [self.repo.rev_to_commit_id(1)])
@@ -629,36 +651,37 @@ class TestSVNRev(unittest.TestCase):
 
 
 class _Test(unittest.TestCase):
-    idgen = ( 'obj_%d' % i for i in count())
+    idgen = ('obj_%d' % i for i in count())
 
     def _make_tree(self, object_id, **kwargs):
         t, isnew = M.repo.Tree.upsert(object_id)
         repo = getattr(self, 'repo', None)
         t.repo = repo
-        for k,v in kwargs.iteritems():
+        for k, v in kwargs.iteritems():
             if isinstance(v, basestring):
                 obj = M.repo.Blob(
                     t, k, self.idgen.next())
                 t.blob_ids.append(Object(
-                        name=k, id=obj._id))
+                    name=k, id=obj._id))
             else:
                 obj = self._make_tree(self.idgen.next(), **v)
                 t.tree_ids.append(Object(
-                        name=k, id=obj._id))
+                    name=k, id=obj._id))
         session(t).flush()
         return t
 
     def _make_commit(self, object_id, **tree_parts):
         ci, isnew = M.repo.Commit.upsert(object_id)
         if isnew:
-            ci.committed.email=c.user.email_addresses[0]
-            ci.authored.email=c.user.email_addresses[0]
+            ci.committed.email = c.user.email_addresses[0]
+            ci.authored.email = c.user.email_addresses[0]
             dt = datetime.utcnow()
             # BSON datetime resolution is to 1 millisecond, not 1 microsecond
             # like Python. Round this now so it'll match the value that's
             # pulled from MongoDB in the tests.
-            ci.authored.date = dt.replace(microsecond=dt.microsecond/1000 * 1000)
-            ci.message='summary\n\nddescription'
+            ci.authored.date = dt.replace(
+                microsecond=dt.microsecond / 1000 * 1000)
+            ci.message = 'summary\n\nddescription'
             ci.set_context(self.repo)
             ci.tree_id = 't_' + object_id
             ci.tree = self._make_tree(ci.tree_id, **tree_parts)
@@ -677,7 +700,9 @@ class _Test(unittest.TestCase):
         ThreadLocalORMSession.close_all()
         self.prefix = tg.config.get('scm.repos.root', '/')
 
+
 class _TestWithRepo(_Test):
+
     def setUp(self):
         super(_TestWithRepo, self).setUp()
         h.set_context('test', neighborhood='Projects')
@@ -690,43 +715,47 @@ class _TestWithRepo(_Test):
             lambda *a, **kw: M.RepositoryImplementation.url_for_commit(
                 self.repo._impl, *a, **kw))
         self.repo._impl._repo = self.repo
-        self.repo._impl.all_commit_ids = lambda *a,**kw: []
+        self.repo._impl.all_commit_ids = lambda *a, **kw: []
         self.repo._impl.commit().symbolic_ids = None
         ThreadLocalORMSession.flush_all()
         # ThreadLocalORMSession.close_all()
 
+
 class _TestWithRepoAndCommit(_TestWithRepo):
+
     def setUp(self):
         super(_TestWithRepoAndCommit, self).setUp()
         self.ci, isnew = self._make_commit('foo')
         ThreadLocalORMSession.flush_all()
         # ThreadLocalORMSession.close_all()
 
+
 class TestRepo(_TestWithRepo):
 
     def test_create(self):
         assert self.repo.fs_path == os.path.join(self.prefix, 'svn/p/test/')
         assert self.repo.url_path == '/p/test/'
-        assert self.repo.full_fs_path == os.path.join(self.prefix, 'svn/p/test/test1')
+        assert self.repo.full_fs_path == os.path.join(
+            self.prefix, 'svn/p/test/test1')
 
     def test_passthrough(self):
         argless = ['init']
         for fn in argless:
             getattr(self.repo, fn)()
             getattr(self.repo._impl, fn).assert_called_with()
-        unary = [ 'commit', 'open_blob' ]
+        unary = ['commit', 'open_blob']
         for fn in unary:
             getattr(self.repo, fn)('foo')
             getattr(self.repo._impl, fn).assert_called_with('foo')
 
     def test_shorthand_for_commit(self):
         self.assertEqual(
-            self.repo.shorthand_for_commit('a'*40),
+            self.repo.shorthand_for_commit('a' * 40),
             '[aaaaaa]')
 
     def test_url_for_commit(self):
         self.assertEqual(
-            self.repo.url_for_commit('a'*40),
+            self.repo.url_for_commit('a' * 40),
             '/p/test/test1/ci/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/')
 
     @mock.patch('allura.model.repository.g.post_event')
@@ -764,11 +793,13 @@ class TestRepo(_TestWithRepo):
         session(M.MergeRequest).clear()
         assert self.repo.merge_requests_by_statuses('open').count() == 1
         assert self.repo.merge_requests_by_statuses('closed').count() == 1
-        assert self.repo.merge_requests_by_statuses('open', 'closed').count() == 2
+        assert self.repo.merge_requests_by_statuses(
+            'open', 'closed').count() == 2
 
     def test_guess_type(self):
         assert self.repo.guess_type('foo.txt') == ('text/plain', None)
-        assert self.repo.guess_type('foo.gbaer') == ('application/octet-stream', None)
+        assert self.repo.guess_type('foo.gbaer') == (
+            'application/octet-stream', None)
         assert self.repo.guess_type('foo.html') == ('text/html', None)
         assert self.repo.guess_type('.gitignore') == ('text/plain', None)
 
@@ -781,15 +812,19 @@ class TestRepo(_TestWithRepo):
         ci.committed.email = committer_email
         ci.author_url = '/u/test-committer/'
         self.repo._impl.commit = mock.Mock(return_value=ci)
-        self.repo._impl.new_commits = mock.Mock(return_value=['foo%d' % i for i in range(100) ])
-        self.repo._impl.all_commit_ids = mock.Mock(return_value=['foo%d' % i for i in range(100) ])
-        self.repo.symbolics_for_commit = mock.Mock(return_value=[['master', 'branch'], []])
+        self.repo._impl.new_commits = mock.Mock(
+            return_value=['foo%d' % i for i in range(100)])
+        self.repo._impl.all_commit_ids = mock.Mock(
+            return_value=['foo%d' % i for i in range(100)])
+        self.repo.symbolics_for_commit = mock.Mock(
+            return_value=[['master', 'branch'], []])
+
         def refresh_commit_info(oid, seen, lazy=False):
             M.repo.CommitDoc(dict(
-                    authored=dict(
-                        name=committer_name,
-                        email=committer_email),
-                    _id=oid)).m.insert()
+                authored=dict(
+                    name=committer_name,
+                    email=committer_email),
+                _id=oid)).m.insert()
         self.repo._impl.refresh_commit_info = refresh_commit_info
         _id = lambda oid: getattr(oid, '_id', str(oid))
         self.repo.shorthand_for_commit = lambda oid: '[' + _id(oid) + ']'
@@ -809,9 +844,11 @@ class TestRepo(_TestWithRepo):
     def test_refresh_private(self):
         ci = mock.Mock()
         self.repo._impl.commit = mock.Mock(return_value=ci)
-        self.repo._impl.new_commits = mock.Mock(return_value=['foo%d' % i for i in range(100) ])
+        self.repo._impl.new_commits = mock.Mock(
+            return_value=['foo%d' % i for i in range(100)])
 
-        # make unreadable by *anonymous, so additional notification logic executes
+        # make unreadable by *anonymous, so additional notification logic
+        # executes
         self.repo.acl = []
         c.project.acl = []
 
@@ -822,7 +859,7 @@ class TestRepo(_TestWithRepo):
         old_app_instance = M.Project.app_instance
         try:
             M.Project.app_instance = mock.Mock(return_value=ming.base.Object(
-                    config=ming.base.Object(_id=None)))
+                config=ming.base.Object(_id=None)))
             with self.repo.push_upstream_context():
                 assert c.project.shortname == 'test'
         finally:
@@ -833,11 +870,12 @@ class TestRepo(_TestWithRepo):
         old_app_instance = M.Project.app_instance
         try:
             M.Project.app_instance = mock.Mock(return_value=ming.base.Object(
-                    config=ming.base.Object(_id=None)))
+                config=ming.base.Object(_id=None)))
             self.repo.pending_upstream_merges()
         finally:
             M.Project.app_instance = old_app_instance
 
+
 class TestMergeRequest(_TestWithRepoAndCommit):
 
     def setUp(self):
@@ -846,8 +884,8 @@ class TestMergeRequest(_TestWithRepoAndCommit):
         h.set_context('test', 'test2', neighborhood='Projects')
         self.repo2 = M.Repository(name='test2', tool='svn')
         self.repo2._impl = mock.Mock(spec=M.RepositoryImplementation())
-        self.repo2._impl.log = lambda *a,**kw:(['foo'], [])
-        self.repo2._impl.all_commit_ids = lambda *a,**kw: []
+        self.repo2._impl.log = lambda *a, **kw: (['foo'], [])
+        self.repo2._impl.all_commit_ids = lambda *a, **kw: []
         self.repo2._impl._repo = self.repo2
         self.repo2.init_as_clone('/p/test/', 'test1', '/p/test/test1/')
         ThreadLocalORMSession.flush_all()
@@ -868,19 +906,24 @@ class TestMergeRequest(_TestWithRepoAndCommit):
         assert_equal(mr.creator_name,  u.get_pref('display_name'))
         assert_equal(mr.creator_url,  u.url())
         assert_equal(mr.downstream_url,  '/p/test/test2/')
-        assert_equal(mr.downstream_repo_url,  'http://svn.localhost/p/test/test2/')
+        assert_equal(mr.downstream_repo_url,
+                     'http://svn.localhost/p/test/test2/')
         with mock.patch('forgesvn.model.svn.SVNLibWrapper') as _svn,\
-             mock.patch('forgesvn.model.svn.SVNImplementation._map_log') as _map_log:
+                mock.patch('forgesvn.model.svn.SVNImplementation._map_log') as _map_log:
             mr.app.repo._impl.head = 1
             _svn().log.return_value = [mock.Mock(revision=mock.Mock(number=2))]
             _map_log.return_value = 'bar'
             assert_equal(mr.commits,  ['bar'])
-            # can't do assert_called_once_with because pysvn.Revision doesn't compare nicely
+            # can't do assert_called_once_with because pysvn.Revision doesn't
+            # compare nicely
             assert_equal(_svn().log.call_count, 1)
-            assert_equal(_svn().log.call_args[0], ('file:///tmp/svn/p/test/test2',))
+            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', None)
+            _map_log.assert_called_once_with(
+                _svn().log.return_value[0], 'file:///tmp/svn/p/test/test2', None)
+
 
 class TestRepoObject(_TestWithRepoAndCommit):
 
@@ -891,7 +934,8 @@ class TestRepoObject(_TestWithRepoAndCommit):
         assert isnew0 and not isnew1
 
     def test_artifact_methods(self):
-        assert self.ci.index_id() == 'allura/model/repo/Commit#foo', self.ci.index_id()
+        assert self.ci.index_id(
+        ) == 'allura/model/repo/Commit#foo', self.ci.index_id()
         assert self.ci.primary() is self.ci, self.ci.primary()
 
 
@@ -946,17 +990,18 @@ class TestCommit(_TestWithRepo):
         M.repo_refresh.refresh_commit_trees(self.ci, {})
         M.repo_refresh.compute_diffs(self.repo._id, {}, self.ci)
         # self.ci.compute_diffs()
-        assert_equal(self.ci.diffs.added, [ 'a', 'a/a', 'a/a/a', 'a/a/b', 'a/b' ])
+        assert_equal(self.ci.diffs.added,
+                     ['a', 'a/a', 'a/a/a', 'a/a/b', 'a/b'])
         assert (self.ci.diffs.copied
                 == self.ci.diffs.changed
                 == self.ci.diffs.removed
                 == [])
         ci, isnew = self._make_commit('bar')
-        ci.parent_ids = [ 'foo' ]
+        ci.parent_ids = ['foo']
         self._make_log(ci)
         M.repo_refresh.refresh_commit_trees(ci, {})
         M.repo_refresh.compute_diffs(self.repo._id, {}, ci)
-        assert_equal(ci.diffs.removed, [ 'a', 'a/a', 'a/a/a', 'a/a/b', 'a/b' ])
+        assert_equal(ci.diffs.removed, ['a', 'a/a', 'a/a/a', 'a/a/b', 'a/b'])
         assert (ci.diffs.copied
                 == ci.diffs.changed
                 == ci.diffs.added
@@ -968,12 +1013,12 @@ class TestCommit(_TestWithRepo):
                     a='',
                     b='',),
                 b=''))
-        ci.parent_ids = [ 'foo' ]
+        ci.parent_ids = ['foo']
         self._make_log(ci)
         M.repo_refresh.refresh_commit_trees(ci, {})
         M.repo_refresh.compute_diffs(self.repo._id, {}, ci)
-        assert_equal(ci.diffs.added, [ 'b', 'b/a', 'b/a/a', 'b/a/b', 'b/b' ])
-        assert_equal(ci.diffs.removed, [ 'a', 'a/a', 'a/a/a', 'a/a/b', 'a/b' ])
+        assert_equal(ci.diffs.added, ['b', 'b/a', 'b/a/a', 'b/a/b', 'b/b'])
+        assert_equal(ci.diffs.removed, ['a', 'a/a', 'a/a/a', 'a/a/b', 'a/b'])
         assert (ci.diffs.copied
                 == ci.diffs.changed
                 == [])
@@ -986,7 +1031,8 @@ class TestCommit(_TestWithRepo):
                 u'/b/a/b': u'Luke Skywalker',
                 u'/b/b': u'Death Star will destroy you',
                 u'/b/c': u'Luke Skywalker',  # moved from /b/a/b
-                u'/b/a/z': u'Death Star will destroy you\nALL',  # moved from /b/b and modified
+                # moved from /b/b and modified
+                u'/b/a/z': u'Death Star will destroy you\nALL',
             }
             from cStringIO import StringIO
             return StringIO(blobs.get(blob.path(), ''))
@@ -995,7 +1041,8 @@ class TestCommit(_TestWithRepo):
         self.repo._impl.commit = mock.Mock(return_value=self.ci)
         M.repo_refresh.refresh_commit_trees(self.ci, {})
         M.repo_refresh.compute_diffs(self.repo._id, {}, self.ci)
-        assert_equal(self.ci.diffs.added, ['a', 'a/a', 'a/a/a', 'a/a/b', 'a/b'])
+        assert_equal(self.ci.diffs.added,
+                     ['a', 'a/a', 'a/a/a', 'a/a/b', 'a/b'])
         assert (self.ci.diffs.copied
                 == self.ci.diffs.changed
                 == self.ci.diffs.removed
@@ -1061,9 +1108,9 @@ class TestRename(unittest.TestCase):
         self.repo = SM.Repository(
             name='testsvn-rename',
             fs_path=repo_dir,
-            url_path = '/test/',
-            tool = 'svn',
-            status = 'creating')
+            url_path='/test/',
+            tool='svn',
+            status='creating')
         self.repo.refresh()
         self.rev = self.repo.commit('HEAD')
         ThreadLocalORMSession.flush_all()
@@ -1079,7 +1126,8 @@ class TestRename(unittest.TestCase):
         )
 
     def test_check_changed_path(self):
-        changed_path = {'copyfrom_path':'/test/path', 'path':'/test/path2'}
-        result = self.repo._impl._check_changed_path(changed_path, '/test/path2/file.txt')
-        assert_equal({'path': '/test/path2/file.txt', 'copyfrom_path': '/test/path/file.txt'}, result)
-
+        changed_path = {'copyfrom_path': '/test/path', 'path': '/test/path2'}
+        result = self.repo._impl._check_changed_path(
+            changed_path, '/test/path2/file.txt')
+        assert_equal({'path': '/test/path2/file.txt',
+                     'copyfrom_path': '/test/path/file.txt'}, result)

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c93733ac/ForgeSVN/forgesvn/tests/model/test_svnimplementation.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/model/test_svnimplementation.py b/ForgeSVN/forgesvn/tests/model/test_svnimplementation.py
index fbd92b8..b9c75d3 100644
--- a/ForgeSVN/forgesvn/tests/model/test_svnimplementation.py
+++ b/ForgeSVN/forgesvn/tests/model/test_svnimplementation.py
@@ -40,7 +40,7 @@ class TestSVNImplementation(object):
     @patch('allura.model.repo.Tree.upsert')
     @patch('allura.model.repo.Tree.query.get')
     def _test_compute_tree_new(self, path, tree_get, tree_upsert, treesdoc_partial, lcd_partial):
-        repo = Mock(fs_path=g.tmpdir+'/')
+        repo = Mock(fs_path=g.tmpdir + '/')
         repo.name = 'code'
         impl = SVNImplementation(repo)
         impl._svn.info2 = Mock()
@@ -52,11 +52,11 @@ class TestSVNImplementation(object):
 
         tree_id = impl.compute_tree_new(commit, path)
 
-        assert_equal(impl._svn.info2.call_args[0][0], 'file://'+g.tmpdir+'/code/trunk/foo')
+        assert_equal(impl._svn.info2.call_args[0]
+                     [0], 'file://' + g.tmpdir + '/code/trunk/foo')
         treesdoc_partial.assert_called()
         lcd_partial.assert_called()
 
-
     def test_last_commit_ids(self):
         self._test_last_commit_ids('/trunk/foo/')
         self._test_last_commit_ids('/trunk/foo')
@@ -64,7 +64,7 @@ class TestSVNImplementation(object):
         self._test_last_commit_ids('trunk/foo')
 
     def _test_last_commit_ids(self, path):
-        repo = Mock(fs_path=g.tmpdir+'/')
+        repo = Mock(fs_path=g.tmpdir + '/')
         repo.name = 'code'
         repo._id = '5057636b9c1040636b81e4b1'
         impl = SVNImplementation(repo)
@@ -76,11 +76,12 @@ class TestSVNImplementation(object):
         entries = impl.last_commit_ids(commit, [path])
 
         assert_equal(entries, {path.strip('/'): '5057636b9c1040636b81e4b1:1'})
-        assert_equal(impl._svn.info2.call_args[0][0], 'file://'+g.tmpdir+'/code/trunk')
+        assert_equal(impl._svn.info2.call_args[0]
+                     [0], 'file://' + g.tmpdir + '/code/trunk')
 
     @patch('forgesvn.model.svn.svn_path_exists')
     def test__path_to_root(self, path_exists):
-        repo = Mock(fs_path=g.tmpdir+'/')
+        repo = Mock(fs_path=g.tmpdir + '/')
         repo.name = 'code'
         repo._id = '5057636b9c1040636b81e4b1'
         impl = SVNImplementation(repo)
@@ -91,15 +92,20 @@ class TestSVNImplementation(object):
         assert_equal(impl._path_to_root('/some/path/'), '')
         assert_equal(impl._path_to_root('some/path'), '')
         # tags
-        assert_equal(impl._path_to_root('/some/path/tags/1.0/some/dir'), 'some/path/tags/1.0')
-        assert_equal(impl._path_to_root('/some/path/tags/1.0/'), 'some/path/tags/1.0')
+        assert_equal(impl._path_to_root('/some/path/tags/1.0/some/dir'),
+                     'some/path/tags/1.0')
+        assert_equal(impl._path_to_root('/some/path/tags/1.0/'),
+                     'some/path/tags/1.0')
         assert_equal(impl._path_to_root('/some/path/tags/'), '')
         # branches
-        assert_equal(impl._path_to_root('/some/path/branches/b1/dir'), 'some/path/branches/b1')
-        assert_equal(impl._path_to_root('/some/path/branches/b1/'), 'some/path/branches/b1')
+        assert_equal(impl._path_to_root('/some/path/branches/b1/dir'),
+                     'some/path/branches/b1')
+        assert_equal(impl._path_to_root('/some/path/branches/b1/'),
+                     'some/path/branches/b1')
         assert_equal(impl._path_to_root('/some/path/branches/'), '')
         # trunk
-        assert_equal(impl._path_to_root('/some/path/trunk/some/dir/'), 'some/path/trunk')
+        assert_equal(impl._path_to_root('/some/path/trunk/some/dir/'),
+                     'some/path/trunk')
         assert_equal(impl._path_to_root('/some/path/trunk'), 'some/path/trunk')
         # with fallback to trunk
         path_exists.return_value = True

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c93733ac/ForgeSVN/forgesvn/tests/test_svn_app.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/test_svn_app.py b/ForgeSVN/forgesvn/tests/test_svn_app.py
index a5ffed7..7fd8545 100644
--- a/ForgeSVN/forgesvn/tests/test_svn_app.py
+++ b/ForgeSVN/forgesvn/tests/test_svn_app.py
@@ -25,6 +25,7 @@ from alluratest.controller import setup_basic_test, setup_global_objects
 from allura.lib import helpers as h
 from forgesvn.tests import with_svn
 
+
 class TestSVNApp(unittest.TestCase):
 
     def setUp(self):

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c93733ac/ForgeSVN/forgesvn/tests/test_tasks.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/test_tasks.py b/ForgeSVN/forgesvn/tests/test_tasks.py
index bd2f723..fb48d56 100644
--- a/ForgeSVN/forgesvn/tests/test_tasks.py
+++ b/ForgeSVN/forgesvn/tests/test_tasks.py
@@ -35,6 +35,7 @@ from allura.tasks import repo_tasks
 
 from forgesvn.tests import with_svn
 
+
 class TestRepoTasks(unittest.TestCase):
 
     def setUp(self):
@@ -76,5 +77,6 @@ class TestRepoTasks(unittest.TestCase):
     def test_uninstall(self):
         with mock.patch.object(shutil, 'rmtree') as f:
             repo_tasks.uninstall()
-            f.assert_called_with(os.path.join(tg.config['scm.repos.root'], 'svn/p/test/src'),
-                                 ignore_errors=True)
+            f.assert_called_with(
+                os.path.join(tg.config['scm.repos.root'], 'svn/p/test/src'),
+                ignore_errors=True)

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c93733ac/ForgeSVN/setup.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/setup.py b/ForgeSVN/setup.py
index d3b1154..a14fdd3 100644
--- a/ForgeSVN/setup.py
+++ b/ForgeSVN/setup.py
@@ -16,7 +16,8 @@
 #       under the License.
 
 from setuptools import setup, find_packages
-import sys, os
+import sys
+import os
 
 from forgesvn.version import __version__
 
@@ -34,7 +35,8 @@ setup(name='ForgeSVN',
       description="",
       long_description="""\
 """,
-      classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
+      # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
+      classifiers=[],
       keywords='',
       author='',
       author_email='',

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c93733ac/ForgeShortUrl/forgeshorturl/main.py
----------------------------------------------------------------------
diff --git a/ForgeShortUrl/forgeshorturl/main.py b/ForgeShortUrl/forgeshorturl/main.py
index 691d25d..72c7b1e 100644
--- a/ForgeShortUrl/forgeshorturl/main.py
+++ b/ForgeShortUrl/forgeshorturl/main.py
@@ -134,6 +134,7 @@ class ForgeShortUrlApp(Application):
 
 
 class RootController(BaseController):
+
     def __init__(self):
         c.short_url_lightbox = W.short_url_lightbox
 
@@ -203,11 +204,11 @@ class ShortURLAdminController(DefaultAdminController):
         validators.NotEmpty(),
         validators.Regex(
             r'^[-_a-zA-Z0-9]+$',
-            messages={'invalid': 'must include only letters, numbers, dashes and underscores.'}
+            messages={'invalid':
+                      'must include only letters, numbers, dashes and underscores.'}
         )
     )
 
-
     def __init__(self, app):
         self.app = app
 
@@ -253,7 +254,7 @@ class ShortURLAdminController(DefaultAdminController):
                     redirect(request.referer)
                 else:
                     msg = ('update short url %s from %s to %s'
-                            % (short_url, shorturl.full_url, full_url))
+                           % (short_url, shorturl.full_url, full_url))
                     flash("Short url updated")
 
             else:
@@ -273,5 +274,5 @@ class ShortURLAdminController(DefaultAdminController):
             M.AuditLog.log(msg)
             redirect(request.referer)
         return dict(
-                app=self.app,
-                url_len=len(ShortUrl.build_short_url(c.app, short_name='')))
+            app=self.app,
+            url_len=len(ShortUrl.build_short_url(c.app, short_name='')))

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c93733ac/ForgeShortUrl/forgeshorturl/model/shorturl.py
----------------------------------------------------------------------
diff --git a/ForgeShortUrl/forgeshorturl/model/shorturl.py b/ForgeShortUrl/forgeshorturl/model/shorturl.py
index 41617bd..b42d30d 100644
--- a/ForgeShortUrl/forgeshorturl/model/shorturl.py
+++ b/ForgeShortUrl/forgeshorturl/model/shorturl.py
@@ -54,7 +54,7 @@ class ShortUrl(M.Artifact):
         except pymongo.errors.DuplicateKeyError:
             session(u).expunge(u)
             u = cls.query.get(short_name=shortname,
-                    app_config_id=c.app.config._id)
+                              app_config_id=c.app.config._id)
         return u
 
     def index(self):
@@ -74,11 +74,11 @@ class ShortUrl(M.Artifact):
     @classmethod
     def build_short_url(cls, app, short_name):
         return config['short_url.url_pattern'].format(
-                base_url=config['base_url'],
-                nbhd=app.project.neighborhood.url_prefix.strip('/'),
-                project=app.project.shortname,
-                mount_point=app.config.options.mount_point,
-                short_name=short_name)
+            base_url=config['base_url'],
+            nbhd=app.project.neighborhood.url_prefix.strip('/'),
+            project=app.project.shortname,
+            mount_point=app.config.options.mount_point,
+            short_name=short_name)
 
     def short_url(self):
         return self.build_short_url(self.app, self.short_name)

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c93733ac/ForgeShortUrl/forgeshorturl/tests/functional/test.py
----------------------------------------------------------------------
diff --git a/ForgeShortUrl/forgeshorturl/tests/functional/test.py b/ForgeShortUrl/forgeshorturl/tests/functional/test.py
index 997050f..67931aa 100644
--- a/ForgeShortUrl/forgeshorturl/tests/functional/test.py
+++ b/ForgeShortUrl/forgeshorturl/tests/functional/test.py
@@ -28,6 +28,7 @@ from forgeshorturl.model import ShortUrl
 
 
 class TestRootController(TestController):
+
     def setUp(self):
         super(TestRootController, self).setUp()
         self.setup_with_tools()
@@ -109,32 +110,38 @@ class TestRootController(TestController):
     def test_shorturl_chars_restrictions(self):
         d = dict(short_url='', full_url='http://sf.net/')
         r = self.app.post('/admin/url/add', params=d)
-        assert ShortUrl.query.find(dict(app_config_id=c.app.config._id)).count() == 0
+        assert ShortUrl.query.find(
+            dict(app_config_id=c.app.config._id)).count() == 0
         assert 'Please enter a value' in self.webflash(r)
         d = dict(short_url='g*', full_url='http://sf.net/')
         r = self.app.post('/admin/url/add', params=d)
-        assert ShortUrl.query.find(dict(app_config_id=c.app.config._id)).count() == 0
-        assert 'Short url: must include only letters, numbers, dashes and underscores.' in self.webflash(r)
+        assert ShortUrl.query.find(
+            dict(app_config_id=c.app.config._id)).count() == 0
+        assert 'Short url: must include only letters, numbers, dashes and underscores.' in self.webflash(
+            r)
 
     def test_shorturl_remove(self):
         self.app.post('/admin/url/add',
-                params=dict(short_url='g', full_url='http://google.com/'))
-        assert ShortUrl.query.find(dict(app_config_id=c.app.config._id)).count() == 1
+                      params=dict(short_url='g', full_url='http://google.com/'))
+        assert ShortUrl.query.find(
+            dict(app_config_id=c.app.config._id)).count() == 1
         self.app.post('/admin/url/remove', params=dict(shorturl='g'))
-        assert ShortUrl.query.find(dict(app_config_id=c.app.config._id)).count() == 0
+        assert ShortUrl.query.find(
+            dict(app_config_id=c.app.config._id)).count() == 0
 
     def test_shorturl_permissions(self):
         self.app.post('/admin/url/add',
-                params=dict(short_url='g', full_url='http://google.com/'),
-                extra_environ=dict(username='test-user'), status=403)
+                      params=dict(short_url='g',
+                                  full_url='http://google.com/'),
+                      extra_environ=dict(username='test-user'), status=403)
         self.app.post('/admin/url/remove', params=dict(shorturl='g'),
-                extra_environ=dict(username='test-user'), status=403)
+                      extra_environ=dict(username='test-user'), status=403)
 
     def test_build_short_url(self):
         with h.push_config(config, **{
                 'short_url.url_pattern': '{base_url}:{nbhd}:{project}:{mount_point}:{short_name}',
                 'base_url': 'b',
-            }):
+        }):
             nbhd = mock.Mock(url_prefix='/n/')
             project = mock.Mock(shortname='p', neighborhood=nbhd)
             app = mock.Mock(project=project)
@@ -155,5 +162,5 @@ class TestRootController(TestController):
         with h.push_config(config, **{
                 'short_url.url_pattern': '{base_url}:{nbhd}:{project}:{mount_point}:{short_name}',
                 'base_url': 'b',
-            }):
+        }):
             assert_equal(surl.short_url(), 'b:p:test:url:test')

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c93733ac/ForgeShortUrl/forgeshorturl/widgets/short_url.py
----------------------------------------------------------------------
diff --git a/ForgeShortUrl/forgeshorturl/widgets/short_url.py b/ForgeShortUrl/forgeshorturl/widgets/short_url.py
index 51f14f4..0094402 100644
--- a/ForgeShortUrl/forgeshorturl/widgets/short_url.py
+++ b/ForgeShortUrl/forgeshorturl/widgets/short_url.py
@@ -20,7 +20,7 @@ from allura.lib.widgets import form_fields as ffw
 
 class ShortUrlFormWidget(ffw.Lightbox):
     defaults = dict(
-            ffw.Lightbox.defaults,
-            name='short-url-modal',
-            trigger='a.add-short-url, a.update-short-url',
-            content_template='forgeshorturl:templates/form.html')
+        ffw.Lightbox.defaults,
+        name='short-url-modal',
+        trigger='a.add-short-url, a.update-short-url',
+        content_template='forgeshorturl:templates/form.html')

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c93733ac/ForgeTracker/forgetracker/command/fix_discussion.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/command/fix_discussion.py b/ForgeTracker/forgetracker/command/fix_discussion.py
index c1f0e7d..95bddb4 100644
--- a/ForgeTracker/forgetracker/command/fix_discussion.py
+++ b/ForgeTracker/forgetracker/command/fix_discussion.py
@@ -27,6 +27,7 @@ from forgetracker.model import Ticket
 
 
 class FixDiscussion(base.Command):
+
     """Fixes trackers that had used buggy 'ticket move' feature before it was fixed.
 
     See [#5727] for details.
@@ -59,41 +60,44 @@ class FixDiscussion(base.Command):
                 ]})
                 if projects.count() > 1:
                     raise exc.ForgeError('Multiple projects has a shortname %s. '
-                            'Use project _id instead.' % p_name_or_id)
+                                         'Use project _id instead.' % p_name_or_id)
                 project = projects.first()
             if not project:
                 raise exc.NoSuchProjectError('The project %s '
-                        'could not be found' % p_name_or_id)
+                                             'could not be found' % p_name_or_id)
 
             self.fix_for_project(project)
         else:
-            base.log.info('Checking discussion instances for each tracker in all projects')
+            base.log.info(
+                'Checking discussion instances for each tracker in all projects')
             for project in M.Project.query.find():
                 self.fix_for_project(project)
 
     def fix_for_project(self, project):
         c.project = project
-        base.log.info('Checking discussion instances for each tracker in project %s' % project.shortname)
+        base.log.info(
+            'Checking discussion instances for each tracker in project %s' %
+            project.shortname)
         trackers = [ac for ac in project.app_configs
-                       if ac.tool_name.lower() == 'tickets']
+                    if ac.tool_name.lower() == 'tickets']
         for tracker in trackers:
             base.log.info('Found tracker %s' % tracker)
             for ticket in Ticket.query.find({'app_config_id': tracker._id}):
                 base.log.info('Processing ticket %s [#%s] %s'
-                        % (ticket._id, ticket.ticket_num, ticket.summary))
+                              % (ticket._id, ticket.ticket_num, ticket.summary))
                 if ticket.discussion_thread.discussion.app_config_id != tracker._id:
                     # Some tickets were moved from this tracker,
                     # and Discussion instance for entire tracker was moved too.
                     # Should move it back.
                     base.log.info("Some tickets were moved from this tracker. "
-                            "Moving tracker's discussion instance back.")
+                                  "Moving tracker's discussion instance back.")
                     ticket.discussion_thread.discussion.app_config_id = tracker._id
 
                 if ticket.discussion_thread.discussion_id != tracker.discussion_id:
                     # Ticket was moved from another tracker.
                     # Should bind his comment thread to tracker's Discussion
                     base.log.info("Ticket was moved from another tracker. "
-                            "Bind ticket's comment thread to tracker's Discussion instance.")
+                                  "Bind ticket's comment thread to tracker's Discussion instance.")
                     ticket.discussion_thread.discussion_id = tracker.discussion_id
                     for post in ticket.discussion_thread.posts:
                         post.discussion_id = tracker.discussion_id

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c93733ac/ForgeTracker/forgetracker/config/resources.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/config/resources.py b/ForgeTracker/forgetracker/config/resources.py
index efcc766..c62d4c4 100644
--- a/ForgeTracker/forgetracker/config/resources.py
+++ b/ForgeTracker/forgetracker/config/resources.py
@@ -17,8 +17,9 @@
 
 import pkg_resources
 
+
 def register_ew_resources(manager):
     manager.register_directory(
         'tracker_js', pkg_resources.resource_filename('forgetracker', 'widgets/resources/js'))
     manager.register_directory(
-        'tracker_css', pkg_resources.resource_filename('forgetracker', 'widgets/resources/css'))
\ No newline at end of file
+        'tracker_css', pkg_resources.resource_filename('forgetracker', 'widgets/resources/css'))


Mime
View raw message