You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by da...@apache.org on 2010/10/18 07:51:53 UTC

svn commit: r1023658 - /subversion/trunk/tools/dev/wc-format.py

Author: danielsh
Date: Mon Oct 18 05:51:52 2010
New Revision: 1023658

URL: http://svn.apache.org/viewvc?rev=1023658&view=rev
Log:
Teach a helper script to look for .svn directories in the parents.

* tools/dev/wc-format.py
  (get_format): Extracted from print_format(), and recurse to parent.
  (print_format): Now a wrapper around get_format().

Modified:
    subversion/trunk/tools/dev/wc-format.py

Modified: subversion/trunk/tools/dev/wc-format.py
URL: http://svn.apache.org/viewvc/subversion/trunk/tools/dev/wc-format.py?rev=1023658&r1=1023657&r2=1023658&view=diff
==============================================================================
--- subversion/trunk/tools/dev/wc-format.py (original)
+++ subversion/trunk/tools/dev/wc-format.py Mon Oct 18 05:51:52 2010
@@ -5,7 +5,7 @@ import sqlite3
 import sys
 
 
-def print_format(wc_path):
+def get_format(wc_path):
   entries = os.path.join(wc_path, '.svn', 'entries')
   wc_db = os.path.join(wc_path, '.svn', 'wc.db')
 
@@ -17,14 +17,22 @@ def print_format(wc_path):
     curs.execute('pragma user_version;')
     formatno = curs.fetchone()[0]
   else:
-    formatno = 'not under version control'
+    parent_path = os.path.dirname(os.path.abspath(wc_path))
+    if wc_path != parent_path:
+      return get_format(parent_path)
+    else:
+      return 'not under version control'
+
+  return formatno
 
+def print_format(wc_path):
   # see subversion/libsvn_wc/wc.h for format values and information
   #   1.0.x -> 1.3.x: format 4
   #   1.4.x: format 8
   #   1.5.x: format 9
   #   1.6.x: format 10
   #   1.7.x: format XXX
+  formatno = get_format(wc_path)
   print '%s: %s' % (wc_path, formatno)