dabo Commit
Revision 2408
Date: 2006-10-30 14:13:59 -0800 (Mon, 30 Oct 2006)
Author: paul
Changed:
U trunk/dabo/__version__.py
Log:
Re-added the svnversion block to __version__.py, to get the correct
version information during development. Fixed the original problem
that made me remove it in the first place (the path of the running
dabo version is gotten more robustly, whereas before I was getting
it from os.cwd() which wasn't always correct).
Fixes tracker item 0222.
I'll follow up with fixes to dabodemo and daboide as well.
Diff:
Modified: trunk/dabo/__version__.py
===================================================================
--- trunk/dabo/__version__.py 2006-10-30 21:25:22 UTC (rev 2407)
+++ trunk/dabo/__version__.py 2006-10-30 22:13:59 UTC (rev 2408)
@@ -5,12 +5,26 @@
import os
-from lib._daborevs import _revs
+import lib
-# We'll get the revision as saved in _daborevs, which is an external svn
-# repository updated by a svn post-commit hook on the server.
+_revision = None
+# First, try to get the revisionfrom svninfo, which lets the developer go back
+# and forth through revisions and the version information will still reflect
+# reality.
+package_path = os.path.split(os.path.split(lib.__file__)[0])[0]
+if os.path.exists(os.path.join(package_path, ".svn")):
+ try:
+ _revision = os.popen("svnversion %s" %
package_path).read().strip()
+ except:
+ pass
-_revision = _revs.get(package_name, "")
+if _revision is None:
+ # Okay, svninfo not available, which probably means svn isn't present,
which
+ # means the version information in lib._daborevs will likely be
correct. That
+ # revision information reflects the current revision at the time the
+ # distribution was rolled up.
+ from lib._daborevs import _revs
+ _revision = _revs.get(package_name, "")
version = {"version": _version,
"revision": _revision}
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev