Discussion:
[ditrack commit] r2341 - src/trunk/tests/dttest
Vlad Skvortsov
2007-11-24 08:52:07 UTC
Permalink
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 use
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
'rev' from a user standpoint. Braces are unnecessary, per our style.
--
Vlad Skvortsov, vss-***@public.gmane.org, http://vss.73rus.com
Ivan Glushkov
2007-11-26 06:23:43 UTC
Permalink
Post by Vlad Skvortsov
+ """
+ Returns the revision of the database
+ """
Which revision? The current or last changed one? The right thing to use
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).
The latest revision. Documentation changed in r2394.
We use here svn_log_last() function, which firstly does 'svn up' and
the get the last log message. So we'll always have the latest revision
here.
Post by Vlad Skvortsov
@@ -533,6 +542,9 @@
rev_arg = ""
+ rev = self.last_rev() + rev
+ assert (rev > 0)
Why not documented? Also, assert makes() more sense before updating
'rev' from a user standpoint. Braces are unnecessary, per our style.
changed in r2393

Ivan.

Loading...