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

[01/15] git commit: [#5973] Contextual reminder if setup-app was not run

Updated Branches:
  refs/heads/master 92607ab47 -> 6127cf7ac


[#5973] Contextual reminder if setup-app was not run


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

Branch: refs/heads/master
Commit: 3004b5f55a7c03df9d8a261d011ddc515b7551ea
Parents: 6db2bc2
Author: Dave Brondsema <db...@geek.net>
Authored: Thu Mar 14 13:19:43 2013 -0400
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Tue Apr 2 21:29:20 2013 +0000

----------------------------------------------------------------------
 Allura/allura/controllers/root.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/3004b5f5/Allura/allura/controllers/root.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/root.py b/Allura/allura/controllers/root.py
index 69c80ec..5ac4767 100644
--- a/Allura/allura/controllers/root.py
+++ b/Allura/allura/controllers/root.py
@@ -75,7 +75,8 @@ class RootController(WsgiDispatchController):
         c.project = c.app = None
         c.memoize_cache = {}
         c.user = plugin.AuthenticationProvider.get(request).authenticate_request()
-        assert c.user is not None, 'c.user should always be at least User.anonymous()'
+        assert c.user is not None, ('c.user should always be at least User.anonymous(). '
+            'Did you run `paster setup-app` to create the database?')
 
     def _cleanup_request(self):
         pass
@@ -90,4 +91,3 @@ class RootController(WsgiDispatchController):
             SitemapEntry(cat.label, '/browse/'+cat.name) for cat in categories
         ]
         return dict(neighborhoods=neighborhoods,title="All Neighborhoods")
-


[14/15] git commit: [#5973] crazy pysvn hacking so that packaging tools know it is in the venv

Posted by tv...@apache.org.
[#5973] crazy pysvn hacking so that packaging tools know it is in the venv


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

Branch: refs/heads/master
Commit: dcf934e01089bc71a81939009abeb6145373e675
Parents: 1f9e46b
Author: Dave Brondsema <db...@geek.net>
Authored: Tue Mar 19 17:57:09 2013 -0700
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Tue Apr 2 21:29:21 2013 +0000

----------------------------------------------------------------------
 README.markdown                               |    3 ++-
 vagrant/manifests/ubuntu-1204-server-amd64.pp |    5 +++++
 2 files changed, 7 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/dcf934e0/README.markdown
----------------------------------------------------------------------
diff --git a/README.markdown b/README.markdown
index bbd03cb..198a0f0 100644
--- a/README.markdown
+++ b/README.markdown
@@ -62,9 +62,10 @@ Although the application setup.py files define a number of dependencies, the `re
 
 This will take a while.  If you get an error from pip, it is typically a temporary download error.  Just run the command again and it will quickly pass through the packages it already downloaded and then continue.
 
-Optional, for SVN support: symlink the system pysvn package into our virtual environment
+Optional, for SVN support: symlink the system pysvn package into our virtual environment and make packaging utilities know its there.
 
     (anvil)~/src/allura$ ln -s /usr/lib/python2.7/dist-packages/pysvn ~/anvil/lib/python2.7/site-packages/
+    (anvil)~/src/allura$ mkdir ~/anvil/lib/python2.7/site-packages/pysvn-1.7.5-py2.7.egg-info
 
 And now to setup the Allura applications for development.  If you want to setup all of them, run `./rebuild-all.bash`
 If you only want to use a few tools, run:

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/dcf934e0/vagrant/manifests/ubuntu-1204-server-amd64.pp
----------------------------------------------------------------------
diff --git a/vagrant/manifests/ubuntu-1204-server-amd64.pp b/vagrant/manifests/ubuntu-1204-server-amd64.pp
index d80e22a..6206350 100644
--- a/vagrant/manifests/ubuntu-1204-server-amd64.pp
+++ b/vagrant/manifests/ubuntu-1204-server-amd64.pp
@@ -102,6 +102,11 @@ file { '/home/vagrant/anvil/lib/python2.7/site-packages/pysvn':
   target => '/usr/lib/python2.7/dist-packages/pysvn',
   require => [ Package[ "python-svn" ], Exec[ "pip install" ]],
 }
+# and trick pip/setuptools etc to know its there
+file { '/home/vagrant/anvil/lib/python2.7/site-packages/pysvn-1.7.5-py2.7.egg-info':
+  ensure => 'directory',
+  require => File['/home/vagrant/anvil/lib/python2.7/site-packages/pysvn'],
+}
 
 # create SCM repo dirs
 file { [ "/home/vagrant/scm", "/home/vagrant/scm/git", "/home/vagrant/scm/hg", "/home/vagrant/scm/svn" ]:


[03/15] git commit: [#5973] preserve deterministic order in diff lists, so tests always pass

Posted by tv...@apache.org.
[#5973] preserve deterministic order in diff lists, so tests always pass


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

Branch: refs/heads/master
Commit: 6127cf7ac716ade1c5f0aa6d5b78b49b4a04dc80
Parents: dcf934e
Author: Dave Brondsema <db...@geek.net>
Authored: Tue Mar 19 18:08:16 2013 -0700
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Tue Apr 2 21:29:21 2013 +0000

----------------------------------------------------------------------
 Allura/allura/model/repo_refresh.py |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/6127cf7a/Allura/allura/model/repo_refresh.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repo_refresh.py b/Allura/allura/model/repo_refresh.py
index 2e176af..ca0c43b 100644
--- a/Allura/allura/model/repo_refresh.py
+++ b/Allura/allura/model/repo_refresh.py
@@ -1,8 +1,7 @@
 import logging
 from itertools import chain
 from cPickle import dumps
-import re
-import os
+from collections import OrderedDict
 
 import bson
 
@@ -423,8 +422,8 @@ def _diff_trees(lhs, rhs, index, *path):
     def _fq(name):
         return '/'.join(reversed(
                 (name,) + path))
-    # Diff the trees
-    rhs_tree_ids = dict(
+    # Diff the trees (and keep deterministic order)
+    rhs_tree_ids = OrderedDict(
         (o.name, o.id)
         for o in rhs.tree_ids)
     for o in lhs.tree_ids:
@@ -443,8 +442,8 @@ def _diff_trees(lhs, rhs, index, *path):
         lhs_tree = Object(_id=None, tree_ids=[], blob_ids=[], other_ids=[])
         for difference in _diff_trees(lhs_tree, index[id], index, name, *path):
             yield difference
-    # DIff the blobs
-    rhs_blob_ids = dict(
+    # Diff the blobs (and keep deterministic order)
+    rhs_blob_ids = OrderedDict(
         (o.name, o.id)
         for o in rhs.blob_ids)
     for o in lhs.blob_ids:


[10/15] git commit: [#5973] Simplify the README

Posted by tv...@apache.org.
[#5973] Simplify the README

* explain SVN is optional (often tricky to install on some platforms)
* use rebuild-all.bash
* omit SCM symlinks since they don't add anything useful (/tmp works just fine for getting started)


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

Branch: refs/heads/master
Commit: d94f287b72e7bbf4f3d47e730336e01b795b6c29
Parents: 92a7522
Author: Dave Brondsema <db...@geek.net>
Authored: Thu Mar 14 11:01:27 2013 -0700
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Tue Apr 2 21:29:21 2013 +0000

----------------------------------------------------------------------
 README.markdown |   47 ++++++++++++++++++-----------------------------
 1 files changed, 18 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d94f287b/README.markdown
----------------------------------------------------------------------
diff --git a/README.markdown b/README.markdown
index 4ef4221..d380157 100644
--- a/README.markdown
+++ b/README.markdown
@@ -17,19 +17,15 @@ We'll use [VirtualBox](http://www.virtualbox.org) and [Ubuntu 12.04](http://ubun
 
 # Installation
 
-Before we begin, you'll need the following additional packages in order to work with the Allura source code.
+Before we begin, you'll need to install some system packages.  [Use google if you need additional PIL/jpeg help.](http://www.google.com/search?q=ubuntu+pil+jpeg+virtualenv)
 
-    ~$ sudo aptitude install git-core subversion python-svn
-
-You'll also need additional development packages in order to compile some of the modules.  [Use google for additional PIL/jpeg help.](http://www.google.com/search?q=ubuntu+pil+jpeg+virtualenv)
-
-    ~$ sudo aptitude install default-jre-headless python-dev libssl-dev libldap2-dev libsasl2-dev libjpeg8-dev zlib1g-dev
+    ~$ sudo aptitude install mongodb-server git-core default-jre-headless python-dev libssl-dev libldap2-dev libsasl2-dev libjpeg8-dev zlib1g-dev
     ~$ sudo ln -s /usr/lib/x86_64-linux-gnu/libz.so /usr/lib
     ~$ sudo ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib
 
-And finally our document-oriented database, MongoDB
+Optional, for SVN support:
 
-    ~$ sudo aptitude install mongodb-server
+    ~$ sudo aptitude install subversion python-svn
 
 If you are using a different base system, make sure you have Mongo 1.8 or better.  If you need to upgrade, you can download the latest from <http://www.mongodb.org/downloads>
 
@@ -44,10 +40,13 @@ Once you have virtualenv installed, you need to create a virtual environment.  W
 
     ~$ virtualenv --system-site-packages anvil
 
-This gives us a nice, clean environment into which we can install all the allura dependencies.  (The site-packages flag is to include the python-svn package).  In order to use the virtual environment, you'll need to activate it.  You'll need to do this whenever you're working on the Allura codebase so you may want to consider adding it to your `~/.bashrc` file.
+This gives us a nice, clean environment into which we can install all the allura dependencies.
+(The --system-site-packages flag is to include the python-svn package).  In order to use the virtual environment, you'll need to activate it:
 
     ~$ . anvil/bin/activate
 
+You'll need to do this whenever you're working on the Allura codebase so you may want to consider adding it to your `~/.bashrc` file.
+
 ## Installing the Allura code and dependencies
 
 Now we can get down to actually getting the Allura code and dependencies downloaded and ready to go.
@@ -63,24 +62,14 @@ Although the application setup.py files define a number of dependencies, the `re
 
 This will take a while.  If you get an error from pip, it is typically a temporary download error.  Just run the command again and it will quickly pass through the packages it already downloaded and then continue.
 
-And now to setup each of the Allura applications for development.  Because there are quite a few (at last count 15), we'll use a simple shell loop to set them up.
-
-    for APP in Allura* Forge* NoWarnings
-    do
-        pushd $APP
-        python setup.py develop
-        popd
-    done
-
-Hopefully everything completed without errors.  We'll also need to create a place for Allura to store any SCM repositories that a project might create.
-
-    for SCM in git svn hg
-    do
-        mkdir -p ~/var/scm/$SCM
-        chmod 777 ~/var/scm/$SCM
-        sudo ln -s ~/var/scm/$SCM /tmp
-    done
+And now to setup the Allura applications for development.  If you want to setup all of them, run `./rebuild-all.bash`
+If you only want to use a few tools, run:
 
+    cd Allura
+    python setup.py develop
+    cd ../ForgeWiki   # required tool
+    python setup.py develop
+    # repeat for any other tools you want to use
 
 ## Initializing the environment
 
@@ -101,18 +90,18 @@ We have a custom config ready for use.
 
 ### Allura task processing
 
-Responds to asynchronous task requests.
+Allura uses a background task service called "taskd" to do async tasks like sending emails, and indexing data into solr, etc.  Let's get it running
 
     (anvil)~$ cd ~/src/allura/Allura
     (anvil)~/src/allura/Allura$ nohup paster taskd development.ini > ~/logs/taskd.log &
 
-### TurboGears application server
+### The application server
 
 In order to initialize the Allura database, you'll need to run the following:
 
     (anvil)~/src/allura/Allura$ paster setup-app development.ini
 
-This shouldn't take too long, but it will start the taskd server doing tons of stuff in the background.  It should complete in 5-6 minutes.  Once this is done, you can start the application server.
+This shouldn't take too long, but it will start the taskd server doing tons of stuff in the background.  It should complete in 5-6 minutes.  Once this is done, you can start the application server:
 
     (anvil)~/src/allura/Allura$ nohup paster serve --reload development.ini > ~/logs/tg.log &
 


[12/15] git commit: [#5973] update repo location

Posted by tv...@apache.org.
[#5973] update repo location


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

Branch: refs/heads/master
Commit: 556feffa63c2b60af9c0001a7f0cfcf2a7f2c40b
Parents: d94f287
Author: Dave Brondsema <db...@geek.net>
Authored: Mon Mar 18 13:26:31 2013 -0700
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Tue Apr 2 21:29:21 2013 +0000

----------------------------------------------------------------------
 CONTRIBUTING |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/556feffa/CONTRIBUTING
----------------------------------------------------------------------
diff --git a/CONTRIBUTING b/CONTRIBUTING
index 3203c5d..5f00209 100644
--- a/CONTRIBUTING
+++ b/CONTRIBUTING
@@ -64,7 +64,7 @@ possible or applicable:
 
 The code is self-hosted in a public git repository.  Get it by cloning:
 
-  git clone git://git.code.sf.net/p/allura/git.git allura
+  git clone https://git-wip-us.apache.org/repos/asf/incubator-allura.git allura
 
 You can also 'fork' our repo at <https://sourceforge.net/p/allura/git/>.
 


[07/15] git commit: [#5973] rename rebuild.bash to rebuild-all.bash with more helpfulness

Posted by tv...@apache.org.
[#5973] rename rebuild.bash to rebuild-all.bash with more helpfulness


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

Branch: refs/heads/master
Commit: d4a0cfdc00f31c4a682a423d58043d42ff1c1696
Parents: a86b081
Author: Dave Brondsema <db...@geek.net>
Authored: Thu Mar 14 10:39:02 2013 -0700
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Tue Apr 2 21:29:21 2013 +0000

----------------------------------------------------------------------
 Makefile.def.buildbot   |    4 ++--
 rebuild-all.bash        |    9 +++++++++
 rebuild.bash            |    8 --------
 update.sh               |    4 ++--
 vagrant/allura_setup.sh |    2 +-
 5 files changed, 14 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d4a0cfdc/Makefile.def.buildbot
----------------------------------------------------------------------
diff --git a/Makefile.def.buildbot b/Makefile.def.buildbot
index 838af38..93aff55 100644
--- a/Makefile.def.buildbot
+++ b/Makefile.def.buildbot
@@ -1,7 +1,7 @@
 test: buildbot_test
 
 buildbot_test:
-	./rebuild.bash
+	./rebuild-all.bash
 	-[ ! -f $(VIRTUAL_ENV)/lib/python2.7/site-packages/pysvn ] && ln -s /usr/lib64/python2.7/site-packages/pysvn $(VIRTUAL_ENV)/lib/python2.7/site-packages/
 	ALLURA_VALIDATION=none ./run_tests
-	./run_clonedigger
\ No newline at end of file
+	./run_clonedigger

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d4a0cfdc/rebuild-all.bash
----------------------------------------------------------------------
diff --git a/rebuild-all.bash b/rebuild-all.bash
new file mode 100755
index 0000000..61b02c6
--- /dev/null
+++ b/rebuild-all.bash
@@ -0,0 +1,9 @@
+#!/bin/bash
+for APP in Allura* *Forge* NoWarnings
+do
+    echo "# setting up $APP dependencies"
+    pushd $APP > /dev/null
+    python setup.py -q develop || echo "    # Error setting up $APP
+    # You may want to run 'pip uninstall $APP' to un-register it so you don't get further errors."
+    popd > /dev/null
+done

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d4a0cfdc/rebuild.bash
----------------------------------------------------------------------
diff --git a/rebuild.bash b/rebuild.bash
deleted file mode 100755
index f1d80a1..0000000
--- a/rebuild.bash
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/bash
-for APP in Allura* *Forge* NoWarnings
-do
-    echo "# setting up $APP dependencies"
-    pushd $APP > /dev/null
-    python setup.py -q develop || exit
-    popd > /dev/null
-done

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d4a0cfdc/update.sh
----------------------------------------------------------------------
diff --git a/update.sh b/update.sh
index 0aa3016..ca5efab 100755
--- a/update.sh
+++ b/update.sh
@@ -17,6 +17,6 @@ if [ "$?" -gt 0 ]; then
 	exit;
 fi
 
-./rebuild.bash
+./rebuild-all.bash
 
-echo 'If you have taskd or the web server running, you should restart them now.'
\ No newline at end of file
+echo 'If you have taskd or the web server running, you should restart them now.'

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d4a0cfdc/vagrant/allura_setup.sh
----------------------------------------------------------------------
diff --git a/vagrant/allura_setup.sh b/vagrant/allura_setup.sh
index cf93e5d..16d77ce 100755
--- a/vagrant/allura_setup.sh
+++ b/vagrant/allura_setup.sh
@@ -39,7 +39,7 @@ fi
 
 # Setup Allura python packages
 cd /home/vagrant/src/forge
-sudo -u vagrant bash -c '. /home/vagrant/anvil/bin/activate; ./rebuild.bash'
+sudo -u vagrant bash -c '. /home/vagrant/anvil/bin/activate; ./rebuild-all.bash'
 
 echo "Purging unneeded packages..."
 aptitude clean


[11/15] git commit: [#5973] symlink pysvn instead of using --system-site-packages

Posted by tv...@apache.org.
[#5973] symlink pysvn instead of using --system-site-packages


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

Branch: refs/heads/master
Commit: 2d9c33d7ea5fa8fbeee1596da9fd315cdf7dc3ee
Parents: 8691037
Author: Dave Brondsema <db...@geek.net>
Authored: Mon Mar 18 13:37:40 2013 -0700
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Tue Apr 2 21:29:21 2013 +0000

----------------------------------------------------------------------
 README.markdown |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/2d9c33d7/README.markdown
----------------------------------------------------------------------
diff --git a/README.markdown b/README.markdown
index d380157..248b8a7 100644
--- a/README.markdown
+++ b/README.markdown
@@ -38,7 +38,7 @@ The first step to installing the Allura platform is installing a virtual environ
 
 Once you have virtualenv installed, you need to create a virtual environment.  We'll call our Allura environment 'anvil'.
 
-    ~$ virtualenv --system-site-packages anvil
+    ~$ virtualenv anvil
 
 This gives us a nice, clean environment into which we can install all the allura dependencies.
 (The --system-site-packages flag is to include the python-svn package).  In order to use the virtual environment, you'll need to activate it:
@@ -62,6 +62,10 @@ Although the application setup.py files define a number of dependencies, the `re
 
 This will take a while.  If you get an error from pip, it is typically a temporary download error.  Just run the command again and it will quickly pass through the packages it already downloaded and then continue.
 
+Optional, for SVN support: symlink the system pysvn package into our virtual environment
+
+    (anvil)~/src/allura$ ln -s /usr/lib/python2.7/dist-packages/pysvn ~/anvil/lib/python2.7/site-packages/
+
 And now to setup the Allura applications for development.  If you want to setup all of them, run `./rebuild-all.bash`
 If you only want to use a few tools, run:
 
@@ -85,6 +89,7 @@ We have a custom config ready for use.
     (anvil)~/src$ cd apache-solr-1.4.1/example/
     (anvil)~/src/apache-solr-1.4.1/example/$ mkdir -p ~/src/allura/solr_config/conf
     (anvil)~/src/apache-solr-1.4.1/example/$ cp solr/conf/solrconfig.xml ~/src/allura/solr_config/conf/
+    (anvil)~/src/apache-solr-1.4.1/example/$ mkdir ~/logs/
     (anvil)~/src/apache-solr-1.4.1/example/$ nohup java -Dsolr.solr.home=$(cd;pwd)/src/allura/solr_config -jar start.jar > ~/logs/solr.log &
 
 
@@ -101,7 +106,7 @@ In order to initialize the Allura database, you'll need to run the following:
 
     (anvil)~/src/allura/Allura$ paster setup-app development.ini
 
-This shouldn't take too long, but it will start the taskd server doing tons of stuff in the background.  It should complete in 5-6 minutes.  Once this is done, you can start the application server:
+This shouldn't take too long, but it will start the taskd server doing tons of stuff in the background.  Once this is done, you can start the application server:
 
     (anvil)~/src/allura/Allura$ nohup paster serve --reload development.ini > ~/logs/tg.log &
 


[13/15] git commit: [#5973] update vagrant scripts

Posted by tv...@apache.org.
[#5973] update vagrant scripts

* update instructions
* update ubuntu base
* various other fixes & improvements


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

Branch: refs/heads/master
Commit: 1baf650e208ce4a017e1d62d21a486e131b59d8b
Parents: 2d9c33d
Author: Dave Brondsema <db...@geek.net>
Authored: Tue Mar 19 11:19:36 2013 -0700
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Tue Apr 2 21:29:21 2013 +0000

----------------------------------------------------------------------
 vagrant/README                                |   14 ++-
 vagrant/Vagrantfile                           |    6 +-
 vagrant/allura_setup.sh                       |   16 ++--
 vagrant/manifests/ubuntu-1204-server-amd64.pp |  134 ++++++++++++++++++++
 vagrant/start_allura                          |    6 +-
 5 files changed, 156 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/1baf650e/vagrant/README
----------------------------------------------------------------------
diff --git a/vagrant/README b/vagrant/README
index f5b4552..69f3bbc 100644
--- a/vagrant/README
+++ b/vagrant/README
@@ -2,20 +2,22 @@ To build an Allura vagrant box:
 
 $ mkdir ~/vagrant_allura && cd ~/vagrant_allura
 
-# Get the base box
-$ vagrant box add ubuntu-1110-server-amd64 http://timhuegdon.com/vagrant-boxes/ubuntu-11.10.box
-$ vagrant init ubuntu-1110-server-amd64
+# Get the base box, see http://www.vagrantbox.es/
+# 12.04 is LTS, so will be good to stick with for some time
+$ vagrant box add ubuntu-1204-server-amd64 http://cloud-images.ubuntu.com/precise/current/precise-server-cloudimg-vagrant-amd64-disk1.box
+$ vagrant init ubuntu-1204-server-amd64
 
-# Get a copy of the provisioning scripts
+# Get a copy of the provisioning scripts (note, Vagrantfile may change from release to release and may need manual updating)
 $ cp -R /var/local/allura/vagrant/* .
 
 # At this point you can make whatever changes you want to the provisioning
-# scripts
+# scripts.  Currently, the .pp puppet file runs first and sets some stuff up
+# and then allura_setup.sh runs and does more.
 
 # Provision the box (this will take a while)
 $ vagrant up
 
-# If you get an error, you can run `vagrant destroy` to start over
+# If you get an error, you can run `vagrant ssh` to get in and debug, and then `vagrant destroy` to start over
 
 # Package the Allura box
 $ vagrant package --vagrantfile Vagrantfile.pkg

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/1baf650e/vagrant/Vagrantfile
----------------------------------------------------------------------
diff --git a/vagrant/Vagrantfile b/vagrant/Vagrantfile
index 9de2455..4852673 100644
--- a/vagrant/Vagrantfile
+++ b/vagrant/Vagrantfile
@@ -7,7 +7,7 @@ Vagrant::Config.run do |config|
   # please see the online documentation at vagrantup.com.
 
   # Every Vagrant virtual environment requires a box to build off of.
-  config.vm.box = "ubuntu-1110-server-amd64"
+  config.vm.box = "ubuntu-1204-server-amd64"
 
   # The url from where the 'config.vm.box' box will be fetched if it
   # doesn't already exist on the user's system.
@@ -40,7 +40,7 @@ Vagrant::Config.run do |config|
   # Enable provisioning with Puppet stand alone.  Puppet manifests
   # are contained in a directory path relative to this Vagrantfile.
   # You will need to create the manifests directory and a manifest in
-  # the file ubuntu-1110-server-amd64.pp in the manifests_path directory.
+  # the file ubuntu-1204-server-amd64.pp in the manifests_path directory.
   #
   # An example Puppet manifest to provision the message of the day:
   #
@@ -57,7 +57,7 @@ Vagrant::Config.run do |config|
   #
   config.vm.provision :puppet do |puppet|
     puppet.manifests_path = "manifests"
-    puppet.manifest_file  = "ubuntu-1110-server-amd64.pp"
+    puppet.manifest_file  = "ubuntu-1204-server-amd64.pp"
   end
 
   config.vm.provision :shell, :path => "allura_setup.sh"

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/1baf650e/vagrant/allura_setup.sh
----------------------------------------------------------------------
diff --git a/vagrant/allura_setup.sh b/vagrant/allura_setup.sh
index 16d77ce..602d247 100755
--- a/vagrant/allura_setup.sh
+++ b/vagrant/allura_setup.sh
@@ -5,12 +5,12 @@ cd /home/vagrant/src
 if [ ! -d apache-solr-1.4.1 ]
 then
     echo "Installing Solr..."
-    wget -q http://apache.mirrors.tds.net/lucene/solr/1.4.1/apache-solr-1.4.1.tgz
+    wget -nv http://archive.apache.org/dist/lucene/solr/1.4.1/apache-solr-1.4.1.tgz
     tar xf apache-solr-1.4.1.tgz && rm -f apache-solr-1.4.1.tgz
     cd apache-solr-1.4.1/example/
-    mkdir -p /home/vagrant/src/forge/solr_config/conf
-    cp solr/conf/solrconfig.xml /home/vagrant/src/forge/solr_config/conf/
-    chown -R vagrant:vagrant /home/vagrant/src/apache-solr* /home/vagrant/src/forge/solr_config/conf/
+    mkdir -p /home/vagrant/src/allura/solr_config/conf
+    cp solr/conf/solrconfig.xml /home/vagrant/src/allura/solr_config/conf/
+    chown -R vagrant:vagrant /home/vagrant/src/apache-solr* /home/vagrant/src/allura/solr_config/conf/
 fi
 
 # Create log dir
@@ -33,20 +33,20 @@ if [ ! -f /home/vagrant/.bash_profile ]
 then
     echo "Creating ~/.bash_profile ..."
     cp /home/vagrant/.profile /home/vagrant/.bash_profile
-    echo -e "\n# Activate Allura virtualenv\n. /home/vagrant/anvil/bin/activate && cd /home/vagrant/src/forge" >> /home/vagrant/.bash_profile
+    echo -e "\n# Activate Allura virtualenv\n. /home/vagrant/anvil/bin/activate && cd /home/vagrant/src/allura" >> /home/vagrant/.bash_profile
     chown vagrant:vagrant /home/vagrant/.bash_profile
 fi
 
 # Setup Allura python packages
-cd /home/vagrant/src/forge
+cd /home/vagrant/src/allura
 sudo -u vagrant bash -c '. /home/vagrant/anvil/bin/activate; ./rebuild-all.bash'
 
 echo "Purging unneeded packages..."
 aptitude clean
 aptitude -y -q purge ri
-aptitude -y -q purge installation-report landscape-common wireless-tools wpasupplicant
+aptitude -y -q purge installation-report landscape-client landscape-common wireless-tools wpasupplicant
 aptitude -y -q purge python-dbus libnl1 python-smartpm linux-headers-server python-twisted-core libiw30 language-selector-common
-aptitude -y -q purge python-twisted-bin libdbus-glib-1-2 python-pexpect python-pycurl python-serial python-gobject python-pam accountsservice libaccountsservice0
+aptitude -y -q purge cloud-init juju python-twisted python-twisted-bin libdbus-glib-1-2 python-pexpect python-serial python-gobject python-pam accountsservice libaccountsservice0
 
 echo "Zeroing free space to aid VM compression..."
 cat /dev/zero > zero.fill;

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/1baf650e/vagrant/manifests/ubuntu-1204-server-amd64.pp
----------------------------------------------------------------------
diff --git a/vagrant/manifests/ubuntu-1204-server-amd64.pp b/vagrant/manifests/ubuntu-1204-server-amd64.pp
new file mode 100644
index 0000000..d80e22a
--- /dev/null
+++ b/vagrant/manifests/ubuntu-1204-server-amd64.pp
@@ -0,0 +1,134 @@
+# create puppet group
+group { "puppet":
+  ensure => "present",
+}
+
+exec { "package index update":
+    command => "/usr/bin/apt-get update",
+}
+
+# install required system packages
+Package { ensure => "installed" }
+
+$packages = [
+ "git-core",
+ "subversion",
+ "python-svn",
+ "default-jre-headless",
+ "python-dev",
+ "libssl-dev",
+ "libldap2-dev",
+ "libsasl2-dev",
+ "libjpeg8-dev",
+ "zlib1g-dev",
+ "mongodb-server",
+ "python-pip"
+]
+
+package { $packages:
+    require => Exec[ "package index update" ],
+}
+
+file { '/usr/lib/libz.so':
+  ensure => 'link',
+  target => '/usr/lib/x86_64-linux-gnu/libz.so',
+  require => Package[ "zlib1g-dev" ],
+}
+file { '/usr/lib/libjpeg.so':
+  ensure => 'link',
+  target => '/usr/lib/x86_64-linux-gnu/libjpeg.so',
+  require => Package[ "libjpeg8-dev" ],
+}
+
+# install python pip
+exec { "install venv":
+  command => "/usr/bin/pip install virtualenv",
+  creates => "/usr/local/bin/virtualenv",
+  require => Package[ "python-pip" ],
+}
+
+# create Allura virtualenv
+exec { "create allura venv":
+  command => "/usr/local/bin/virtualenv anvil",
+  cwd     => "/home/vagrant",
+  creates => "/home/vagrant/anvil",
+  user => "vagrant",
+  group => "vagrant",
+  require => Exec[ "install venv" ],
+}
+
+# create dir for Allura source
+file { "/home/vagrant/src":
+  ensure => "directory",
+  owner => "vagrant",
+  group => "vagrant",
+}
+
+# create dir for Allura logs
+file { "/var/log/allura":
+  ensure => "directory",
+  owner => "vagrant",
+  group => "vagrant",
+}
+
+# clone Allura source from git
+exec { "clone repo":
+  command => "/usr/bin/git clone https://git-wip-us.apache.org/repos/asf/incubator-allura.git allura",
+  cwd     => "/home/vagrant/src",
+  creates => "/home/vagrant/src/allura",
+  user => "vagrant",
+  group => "vagrant",
+  require => [ File[ "/home/vagrant/src" ], Package[ "git-core" ] ],
+}
+
+# install Allura dependencies
+exec { "pip install":
+  command => "/home/vagrant/anvil/bin/pip install -r requirements.txt",
+  cwd     => "/home/vagrant/src/allura",
+  user => "vagrant",
+  group => "vagrant",
+  timeout => 0,
+  logoutput => true,
+  returns => 0,
+  tries => 3,
+  require => [ Exec[ "clone repo"], Exec[ "create allura venv" ],
+               File["/usr/lib/libjpeg.so"], File["/usr/lib/libz.so"],
+               ],
+}
+
+# symlink pysvn in from the system installation
+file { '/home/vagrant/anvil/lib/python2.7/site-packages/pysvn':
+  ensure => 'link',
+  target => '/usr/lib/python2.7/dist-packages/pysvn',
+  require => [ Package[ "python-svn" ], Exec[ "pip install" ]],
+}
+
+# create SCM repo dirs
+file { [ "/home/vagrant/scm", "/home/vagrant/scm/git", "/home/vagrant/scm/hg", "/home/vagrant/scm/svn" ]:
+  ensure => "directory",
+  owner => "vagrant",
+  group => "vagrant",
+  mode   => 777,
+}
+
+# create symlinks to repo dirs
+file { '/git':
+  ensure => "link",
+  target => "/home/vagrant/scm/git",
+  owner => "vagrant",
+  group => "vagrant",
+}
+
+file { '/hg':
+  ensure => "link",
+  target => "/home/vagrant/scm/hg",
+  owner => "vagrant",
+  group => "vagrant",
+}
+
+file { '/svn':
+  ensure => "link",
+  target => "/home/vagrant/scm/svn",
+  owner => "vagrant",
+  group => "vagrant",
+}

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/1baf650e/vagrant/start_allura
----------------------------------------------------------------------
diff --git a/vagrant/start_allura b/vagrant/start_allura
index d9f228f..8c66187 100755
--- a/vagrant/start_allura
+++ b/vagrant/start_allura
@@ -19,10 +19,10 @@ then
 else
     echo "Starting Solr..."
     cd /home/vagrant/src/apache-solr-1.4.1/example
-    nohup java -Dsolr.solr.home=/home/vagrant/src/forge/solr_config -jar start.jar >/var/log/allura/solr.log 2>&1 &
+    nohup java -Dsolr.solr.home=/home/vagrant/src/allura/solr_config -jar start.jar >/var/log/allura/solr.log 2>&1 &
 fi
 
-cd /home/vagrant/src/forge/Allura
+cd /home/vagrant/src/allura/Allura
 
 # Start taskd
 if pgrep -f "paster taskd" >/dev/null
@@ -37,7 +37,7 @@ fi
 if [ ! -f /var/lib/mongodb/allura.0 ]
 then
     echo "Initializing database..."
-    paster setup-app development.ini >/var/log/allura/setup-app.log 2>&1
+    paster setup-app development.ini >/var/log/allura/setup-app.log 2>&1 || echo "Error, see /var/log/allura/setup-app.log"
 fi
 
 # Start the web server


[09/15] git commit: [#5973] remove ancient README within the Allura dir since we have a top-level one

Posted by tv...@apache.org.
[#5973] remove ancient README within the Allura dir since we have a top-level one


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

Branch: refs/heads/master
Commit: 92a7522c6a57482e4995d1e144fac3150b04b5d0
Parents: b0c97b9
Author: Dave Brondsema <db...@geek.net>
Authored: Thu Mar 14 10:50:16 2013 -0700
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Tue Apr 2 21:29:21 2013 +0000

----------------------------------------------------------------------
 Allura/README.txt |   24 ------------------------
 1 files changed, 0 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/92a7522c/Allura/README.txt
----------------------------------------------------------------------
diff --git a/Allura/README.txt b/Allura/README.txt
deleted file mode 100644
index 929d51d..0000000
--- a/Allura/README.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-This file is for you to describe the allura application. Typically
-you would include information such as the information below:
-
-Installation and Setup
-======================
-
-Install ``allura`` using the setup.py script::
-
-    $ cd allura
-    $ python setup.py install
-
-Create the project database for any model classes defined::
-
-    $ paster setup-app development.ini
-
-Start the paste http server::
-
-    $ paster serve development.ini
-
-While developing you may want the server to reload after changes in package files (or its dependencies) are saved. This can be achieved easily by adding the --reload option::
-
-    $ paster serve --reload development.ini
-
-Then you are ready to go.


[04/15] git commit: [#5973] move ipython requirement since it is used in tests

Posted by tv...@apache.org.
[#5973] move ipython requirement since it is used in 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/8691037c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/8691037c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/8691037c

Branch: refs/heads/master
Commit: 8691037c0d9a1b144f7b9132c6cc1f4953578bbc
Parents: 556feff
Author: Dave Brondsema <db...@geek.net>
Authored: Mon Mar 18 13:30:13 2013 -0700
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Tue Apr 2 21:29:21 2013 +0000

----------------------------------------------------------------------
 requirements-common.txt |    1 +
 requirements-sf.txt     |    1 -
 2 files changed, 1 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/8691037c/requirements-common.txt
----------------------------------------------------------------------
diff --git a/requirements-common.txt b/requirements-common.txt
index 03d76f4..eded3e8 100644
--- a/requirements-common.txt
+++ b/requirements-common.txt
@@ -68,6 +68,7 @@ smmap==0.8.1
 
 # testing & development
 datadiff==1.1.5
+ipython==0.11
 mock==0.8.0
 nose==1.1.2
 pyflakes==0.5.0

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/8691037c/requirements-sf.txt
----------------------------------------------------------------------
diff --git a/requirements-sf.txt b/requirements-sf.txt
index 7b66bc3..f6dc6f4 100644
--- a/requirements-sf.txt
+++ b/requirements-sf.txt
@@ -29,7 +29,6 @@ mediawiki==0.0.1
 
 # development
 blessings==1.3
-ipython==0.11
 nose-progressive==1.3
 pyprof2calltree==1.1.0
 repoze.profile==1.3


[08/15] git commit: [#5973] Make the pysvn dep explicit, so we fail sooner (setup.py develop instead of runtime import)

Posted by tv...@apache.org.
[#5973] Make the pysvn dep explicit, so we fail sooner (setup.py develop instead of runtime import)


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

Branch: refs/heads/master
Commit: b0c97b952b3671f0e45c7f030ba920bf280abffa
Parents: d4a0cfd
Author: Dave Brondsema <db...@geek.net>
Authored: Thu Mar 14 10:46:43 2013 -0700
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Tue Apr 2 21:29:21 2013 +0000

----------------------------------------------------------------------
 ForgeSVN/setup.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/b0c97b95/ForgeSVN/setup.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/setup.py b/ForgeSVN/setup.py
index fba4631..dbd6932 100644
--- a/ForgeSVN/setup.py
+++ b/ForgeSVN/setup.py
@@ -19,7 +19,8 @@ setup(name='ForgeSVN',
       zip_safe=False,
       install_requires=[
           # -*- Extra requirements: -*-
-          'Allura'
+          'Allura',
+          'pysvn',
       ],
       entry_points="""
       # -*- Entry points: -*-


[15/15] git commit: [#5973] mention port forwarding

Posted by tv...@apache.org.
[#5973] mention port forwarding


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

Branch: refs/heads/master
Commit: 65932e37d4787e030a916819675a6953f223ad1c
Parents: 1baf650
Author: Dave Brondsema <db...@geek.net>
Authored: Tue Mar 19 11:31:55 2013 -0700
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Tue Apr 2 21:29:21 2013 +0000

----------------------------------------------------------------------
 README.markdown |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/65932e37/README.markdown
----------------------------------------------------------------------
diff --git a/README.markdown b/README.markdown
index 248b8a7..bbd03cb 100644
--- a/README.markdown
+++ b/README.markdown
@@ -112,7 +112,9 @@ This shouldn't take too long, but it will start the taskd server doing tons of s
 
 ## Next Steps
 
-Go to the server running on your [local machine](http://localhost:8080/) port 8080.
+Go to the Allura webapp running on your [local machine](http://localhost:8080/) port 8080.
+(If you're running this inside a VM, you'll probably have to configure the port forwarding settings)
+
 You can log in with username admin1, test-user or root.  They all have password "foo".  (For more details
 on the default data, see bootstrap.py)
 


[02/15] git commit: [#5973] remove pysvn dependency from Allura package

Posted by tv...@apache.org.
[#5973] remove pysvn dependency from Allura package


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

Branch: refs/heads/master
Commit: 6db2bc233a5aa4b33b0b4e131c2754b6df7903fe
Parents: 92607ab
Author: Dave Brondsema <db...@geek.net>
Authored: Thu Mar 14 13:04:42 2013 -0400
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Tue Apr 2 21:29:20 2013 +0000

----------------------------------------------------------------------
 Allura/allura/lib/utils.py                       |   10 ----------
 ForgeSVN/forgesvn/model/svn.py                   |   10 +++++++++-
 ForgeSVN/forgesvn/svn_main.py                    |    2 +-
 ForgeSVN/forgesvn/tests/model/test_repository.py |    2 +-
 4 files changed, 11 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/6db2bc23/Allura/allura/lib/utils.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/utils.py b/Allura/allura/lib/utils.py
index fa63b38..6e2d3b8 100644
--- a/Allura/allura/lib/utils.py
+++ b/Allura/allura/lib/utils.py
@@ -27,7 +27,6 @@ from pygments.formatters import HtmlFormatter
 
 from ew import jinja2_ew as ew
 from ming.utils import LazyProperty
-import pysvn
 
 def permanent_redirect(url):
     try:
@@ -418,15 +417,6 @@ def generate_code_stats(blob):
     return stats
 
 
-def svn_path_exists(path):
-    svn = pysvn.Client()
-    try:
-        svn.info2(path)
-        return True
-    except pysvn.ClientError, e:
-        return False
-
-
 def is_text_file(file):
     msg = magic.from_buffer(file[:1024])
     if ("text" in msg) or ("empty" in msg):

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/6db2bc23/ForgeSVN/forgesvn/model/svn.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/model/svn.py b/ForgeSVN/forgesvn/model/svn.py
index 171c709..4d09534 100644
--- a/ForgeSVN/forgesvn/model/svn.py
+++ b/ForgeSVN/forgesvn/model/svn.py
@@ -26,7 +26,6 @@ from ming.utils import LazyProperty
 from allura import model as M
 from allura.lib import helpers as h
 from allura.model.auth import User
-from allura.lib.utils import svn_path_exists
 
 log = logging.getLogger(__name__)
 
@@ -98,6 +97,15 @@ class SVNCalledProcessError(Exception):
             (self.cmd, self.returncode, self.stdout, self.stderr)
 
 
+def svn_path_exists(path):
+    svn = SVNLibWrapper(pysvn.Client())
+    try:
+        svn.info2(path)
+        return True
+    except pysvn.ClientError:
+        return False
+
+
 class SVNLibWrapper(object):
     """Wrapper around pysvn, used for instrumentation."""
     def __init__(self, client):

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/6db2bc23/ForgeSVN/forgesvn/svn_main.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/svn_main.py b/ForgeSVN/forgesvn/svn_main.py
index 29e531a..2df8ea4 100644
--- a/ForgeSVN/forgesvn/svn_main.py
+++ b/ForgeSVN/forgesvn/svn_main.py
@@ -18,13 +18,13 @@ from allura.lib.repository import RepositoryApp, RepoAdminController
 from allura.app import SitemapEntry, ConfigOption
 from allura.lib import helpers as h
 from allura import model as M
-from allura.lib.utils import svn_path_exists
 
 # Local imports
 from . import model as SM
 from . import version
 from . import widgets
 from .controllers import BranchBrowser
+from .model.svn import svn_path_exists
 
 log = logging.getLogger(__name__)
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/6db2bc23/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 43d6cbc..89964a7 100644
--- a/ForgeSVN/forgesvn/tests/model/test_repository.py
+++ b/ForgeSVN/forgesvn/tests/model/test_repository.py
@@ -17,11 +17,11 @@ from ming.orm import session, ThreadLocalORMSession
 from alluratest.controller import setup_basic_test, setup_global_objects
 from allura import model as M
 from allura.lib import helpers as h
-from allura.lib.utils import svn_path_exists
 from allura.tests import decorators as td
 from allura.tests.model.test_repo import RepoImplTestBase
 
 from forgesvn import model as SM
+from forgesvn.model.svn import svn_path_exists
 from forgesvn.tests import with_svn
 
 class TestNewRepo(unittest.TestCase):


[06/15] git commit: [#5973] don't install ForgeActivity app if it's not enabled

Posted by tv...@apache.org.
[#5973] don't install ForgeActivity app if it's not enabled


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

Branch: refs/heads/master
Commit: a86b081d5bdf4a32a5fe0d93bd1aa2ffc8927ba4
Parents: 3004b5f
Author: Dave Brondsema <db...@geek.net>
Authored: Thu Mar 14 13:20:20 2013 -0400
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Tue Apr 2 21:29:21 2013 +0000

----------------------------------------------------------------------
 Allura/allura/model/project.py |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/a86b081d/Allura/allura/model/project.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/project.py b/Allura/allura/model/project.py
index 9f07f67..39509ff 100644
--- a/Allura/allura/model/project.py
+++ b/Allura/allura/model/project.py
@@ -5,6 +5,7 @@ from datetime import datetime
 from tg import config
 from pylons import tmpl_context as c, app_globals as g
 from pylons import request
+from paste.deploy.converters import asbool
 
 from ming import schema as S
 from ming.utils import LazyProperty
@@ -709,16 +710,17 @@ class Project(MappedClass, ActivityNode, ActivityObject):
         self.notifications_disabled = True
         if users is None: users = [ c.user ]
         if apps is None:
+            apps = []
             if is_user_project:
-                apps = [('Wiki', 'wiki', 'Wiki'),
+                apps += [('Wiki', 'wiki', 'Wiki'),
                         ('profile', 'profile', 'Profile'),
-                        ('admin', 'admin', 'Admin'),
-                        ('search', 'search', 'Search'),
-                        ('activity', 'activity', 'Activity')]
-            else:
-                apps = [('admin', 'admin', 'Admin'),
-                        ('search', 'search', 'Search'),
-                        ('activity', 'activity', 'Activity')]
+                       ]
+            apps += [
+                ('admin', 'admin', 'Admin'),
+                ('search', 'search', 'Search'),
+            ]
+            if asbool(config.get('activitystream.enabled', False)):
+                apps.append(('activity', 'activity', 'Activity'))
         with h.push_config(c, project=self, user=users[0]):
             # Install default named roles (#78)
             root_project_id=self.root_project._id


[05/15] git commit: [#5973] remove sf.net-specific shorturl migration

Posted by tv...@apache.org.
[#5973] remove sf.net-specific shorturl migration


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

Branch: refs/heads/master
Commit: 1f9e46b3063e07689f940b13af2960be0233002f
Parents: 65932e3
Author: Dave Brondsema <db...@geek.net>
Authored: Tue Mar 19 19:10:42 2013 +0000
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Tue Apr 2 21:29:21 2013 +0000

----------------------------------------------------------------------
 ForgeShortUrl/forgeshorturl/command/base.py        |    5 -
 .../forgeshorturl/command/migrate_urls.py          |  106 ---------------
 ForgeShortUrl/forgeshorturl/tests/test_commands.py |   71 ----------
 ForgeShortUrl/setup.py                             |    2 -
 4 files changed, 0 insertions(+), 184 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/1f9e46b3/ForgeShortUrl/forgeshorturl/command/__init__.py
----------------------------------------------------------------------
diff --git a/ForgeShortUrl/forgeshorturl/command/__init__.py b/ForgeShortUrl/forgeshorturl/command/__init__.py
deleted file mode 100644
index e69de29..0000000

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/1f9e46b3/ForgeShortUrl/forgeshorturl/command/base.py
----------------------------------------------------------------------
diff --git a/ForgeShortUrl/forgeshorturl/command/base.py b/ForgeShortUrl/forgeshorturl/command/base.py
deleted file mode 100644
index 08ef1b2..0000000
--- a/ForgeShortUrl/forgeshorturl/command/base.py
+++ /dev/null
@@ -1,5 +0,0 @@
-from allura.command.base import Command
-
-
-class ShortUrlCommand(Command):
-    group_name = 'ForgeShortUrl'

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/1f9e46b3/ForgeShortUrl/forgeshorturl/command/migrate_urls.py
----------------------------------------------------------------------
diff --git a/ForgeShortUrl/forgeshorturl/command/migrate_urls.py b/ForgeShortUrl/forgeshorturl/command/migrate_urls.py
deleted file mode 100644
index 5d339e5..0000000
--- a/ForgeShortUrl/forgeshorturl/command/migrate_urls.py
+++ /dev/null
@@ -1,106 +0,0 @@
-import tg
-import warnings
-from pylons import tmpl_context as c
-import bson
-from forgeshorturl.command.base import ShortUrlCommand
-from forgeshorturl.model import ShortUrl
-from allura.lib import exceptions
-from allura.lib import helpers as h
-from allura import model as M
-from ming.orm import session
-import sqlalchemy
-from datetime import datetime
-
-
-class MigrateUrls(ShortUrlCommand):
-    """Usage example:
-
-    paster migrate-urls ../Allura/development.ini sfurl allura.p
-
-    The following settings are read from the INI file:
-
-        sfx.hostedapps_db.hostname
-        sfx.hostedapps_db.port
-        sfx.hostedapps_db.username
-        sfx.hostedapps_db.password
-    """
-    min_args = 3
-    max_args = 3
-    usage = '<ini file> <database name> <project name>'
-    summary = 'Migrate short URLs from the SFX Hosted App to Allura'
-    parser = ShortUrlCommand.standard_parser(verbose=True)
-    parser.add_option('-m', dest='mount_point', type='string', default='url',
-                      help='mount point (default: url)')
-    parser.add_option('-n', dest='nbhd', type='string', default='p',
-                      help='neighborhood shortname or _id (default: p)')
-    parser.add_option('--clean', dest='clean', action='store_true', default=False,
-                      help='clean existing short URLs from Allura')
-
-    def command(self):
-        self._setup()
-        self._load_objects()
-
-        if self.options.clean:
-            ShortUrl.query.remove({'app_config_id': c.app.config._id})
-
-        for row in self.urls.select().execute():
-            url = ShortUrl.upsert(h.really_unicode(row['short_id']))
-            url.full_url = h.really_unicode(row['url'])
-            url.description = h.really_unicode(row['description'])
-            url.private = row['private'] == 'Y'
-            url.created = datetime.utcfromtimestamp(row['create_time'])
-            url.last_updated = datetime.utcfromtimestamp(row['edit_time'])
-            user = M.User.query.find({'tool_data.sfx.userid': row['create_user']}).first()
-            url.create_user = user._id if user else M.User.anonymous()._id
-
-        session(ShortUrl).flush()
-
-    def _setup(self):
-        '''Perform basic setup, suppressing superfluous warnings.'''
-        with warnings.catch_warnings():
-            try:
-                from sqlalchemy import exc
-            except ImportError:
-                pass
-            else:
-                warnings.simplefilter("ignore", category=exc.SAWarning)
-            self.basic_setup()
-
-        db = sqlalchemy.create_engine(self._connection_string())
-        meta = sqlalchemy.MetaData()
-        meta.bind = db
-        self.urls = sqlalchemy.Table('sfurl', meta, autoload=True)
-
-    def _connection_string(self):
-        prefix = 'sfx.hostedapps_db.'
-        params = {
-            'host': tg.config.get(prefix + 'hostname', 'localhost'),
-            'port': tg.config.get(prefix + 'port', 3306),
-            'user': tg.config.get(prefix + 'username', ''),
-            'pwd': tg.config.get(prefix + 'password', ''),
-            'db': self.args[1]
-        }
-        return 'mysql://%(user)s:%(pwd)s@%(host)s:%(port)s/%(db)s' % params
-
-    def _load_objects(self):
-        nbhd = None
-        try:
-            nbhd = M.Neighborhood.query.get(_id=bson.ObjectId(self.options.nbhd))
-        except bson.errors.InvalidId:
-            nbhd = M.Neighborhood.query.find({'$or': [
-                {'url_prefix': '/%s/' % self.options.nbhd},
-                {'name': self.options.nbhd},
-            ]}).first()
-        assert nbhd, 'Neighborhood %s not found' % self.options.nbhd
-        try:
-            c.project = M.Project.query.get(_id=bson.ObjectId(self.args[2]))
-        except bson.errors.InvalidId:
-            c.project = M.Project.query.find({'$or': [
-                {'shortname': self.args[2]},
-                {'name': self.args[2]},
-            ]}).first()
-        if not c.project:
-            raise exceptions.NoSuchProjectError('The project %s '
-                    'could not be found in the database' % self.args[2])
-        c.app = c.project.app_instance(self.options.mount_point)
-        assert c.app, 'Project does not have ShortURL app installed'

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/1f9e46b3/ForgeShortUrl/forgeshorturl/tests/test_commands.py
----------------------------------------------------------------------
diff --git a/ForgeShortUrl/forgeshorturl/tests/test_commands.py b/ForgeShortUrl/forgeshorturl/tests/test_commands.py
deleted file mode 100644
index 4ccf60e..0000000
--- a/ForgeShortUrl/forgeshorturl/tests/test_commands.py
+++ /dev/null
@@ -1,71 +0,0 @@
-from nose.tools import assert_equal
-from alluratest.controller import setup_basic_test, setup_global_objects
-from forgeshorturl.command import migrate_urls
-from forgeshorturl.model import ShortUrl
-from allura import model as M
-from mock import patch, MagicMock, Mock
-
-test_config = 'test.ini#main'
-
-
-def setUp(self):
-    """Method called by nose before running each test"""
-    setup_basic_test()
-    setup_global_objects()
-
-
-class TableMock(MagicMock):
-
-    def select(self):
-        m = Mock()
-        m.execute = self.execute
-        return m
-
-    def execute(self):
-        test_urls = [
-            {
-                'short_id': 'g',
-                'url': 'http://google.com',
-                'description': 'Two\nlines',
-                'private': 'N',
-                'create_time': 1,
-                'edit_time': 2,
-                'create_user': 1
-            },
-            {
-                'short_id': 'y',
-                'url': 'http://yahoo.com',
-                'description': 'One line',
-                'private': 'Y',
-                'create_time': 3,
-                'edit_time': 4,
-                'create_user': 1
-            }
-        ]
-        for url in test_urls:
-            yield url
-
-
-@patch('sqlalchemy.Table', TableMock)
-def test_migrate_urls():
-    p = M.Project.query.find().first()
-    app = p.app_instance('url')
-    if not app:
-        app = p.install_app('ShortUrl')
-    assert_equal(ShortUrl.query.find({'app_config_id': app.config._id}).count(), 0)
-
-    cmd = migrate_urls.MigrateUrls('migrate-urls')
-    cmd.run([test_config, 'db_name', str(p._id)])
-    assert_equal(ShortUrl.query.find({'app_config_id': app.config._id}).count(), 2)
-
-    u = ShortUrl.query.find(dict(app_config_id=app.config._id, short_name='g')).first()
-    assert_equal(u.full_url, 'http://google.com')
-    assert_equal(u.description, 'Two\nlines')
-    assert not u.private
-    assert_equal(u.create_user, M.User.anonymous()._id)
-
-    u = ShortUrl.query.find(dict(app_config_id=app.config._id, short_name='y')).first()
-    assert_equal(u.full_url, 'http://yahoo.com')
-    assert_equal(u.description, 'One line')
-    assert u.private
-    assert_equal(u.create_user, M.User.anonymous()._id)

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/1f9e46b3/ForgeShortUrl/setup.py
----------------------------------------------------------------------
diff --git a/ForgeShortUrl/setup.py b/ForgeShortUrl/setup.py
index 62fc1ce..4b3a2a2 100644
--- a/ForgeShortUrl/setup.py
+++ b/ForgeShortUrl/setup.py
@@ -19,6 +19,4 @@ setup(name='ForgeShortUrl',
       [allura]
       ShortURL=forgeshorturl.main:ForgeShortUrlApp
 
-      [paste.paster_command]
-      migrate-urls=forgeshorturl.command.migrate_urls:MigrateUrls
       """,)