Vlad Skvortsov
2007-11-24 08:52:07 UTC
Author: gli
Date: 2007-11-12 07:54:01 -0800 (Mon, 12 Nov 2007)
New Revision: 2341
src/trunk/tests/dttest/dttest.py
new function last_rev(). It would return last revision of database.
Modified: src/trunk/tests/dttest/dttest.py
===================================================================
--- src/trunk/tests/dttest/dttest.py 2007-11-12 14:57:35 UTC (rev 2340)
+++ src/trunk/tests/dttest/dttest.py 2007-11-12 15:54:01 UTC (rev 2341)
@@ -379,6 +379,15 @@
return issue_path
+ """
+ Returns the revision of the database
+ """
Which revision? The current or last changed one? The right thing to useDate: 2007-11-12 07:54:01 -0800 (Mon, 12 Nov 2007)
New Revision: 2341
src/trunk/tests/dttest/dttest.py
new function last_rev(). It would return last revision of database.
Modified: src/trunk/tests/dttest/dttest.py
===================================================================
--- src/trunk/tests/dttest/dttest.py 2007-11-12 14:57:35 UTC (rev 2340)
+++ src/trunk/tests/dttest/dttest.py 2007-11-12 15:54:01 UTC (rev 2341)
@@ -379,6 +379,15 @@
return issue_path
+ """
+ Returns the revision of the database
+ """
here is actually 'svn info', since 'svn log' might not always return the
HEAD revision in its output (e.g. right after "commit" before any
"update" took place).
+ svnlog = "svn_log.out"
+ self.svn_log_last(outfile=svnlog)
+ last_rev = int(open(svnlog, "r").readlines()[1].split()[0][1:])
+ return last_rev
+
lma = shelve.open(self.path["lma"])
entity = lma[id]
@@ -533,6 +542,9 @@
rev_arg = ""
+ rev = self.last_rev() + rev
+ assert (rev > 0)
Why not documented? Also, assert makes() more sense before updating+ self.svn_log_last(outfile=svnlog)
+ last_rev = int(open(svnlog, "r").readlines()[1].split()[0][1:])
+ return last_rev
+
lma = shelve.open(self.path["lma"])
entity = lma[id]
@@ -533,6 +542,9 @@
rev_arg = ""
+ rev = self.last_rev() + rev
+ assert (rev > 0)
'rev' from a user standpoint. Braces are unnecessary, per our style.
--
Vlad Skvortsov, vss-***@public.gmane.org, http://vss.73rus.com
Vlad Skvortsov, vss-***@public.gmane.org, http://vss.73rus.com