mailr23346 - in /branches/frame_order_cleanup: ./ version.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on May 22, 2014 - 18:21:
Author: bugman
Date: Thu May 22 18:21:16 2014
New Revision: 23346

URL: http://svn.gna.org/viewcvs/relax?rev=23346&view=rev
Log:
Merged revisions 23345 via svnmerge from 
svn+ssh://bugman@xxxxxxxxxxx/svn/relax/trunk

........
  r23345 | bugman | 2014-05-22 18:18:27 +0200 (Thu, 22 May 2014) | 3 lines
  
  Improvements for the git-svn support in the relax version module.
  
  Python 3 is now correctly handled and the URL is properly extracted from 
the git repository.
........

Modified:
    branches/frame_order_cleanup/   (props changed)
    branches/frame_order_cleanup/version.py

Propchange: branches/frame_order_cleanup/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu May 22 18:21:16 2014
@@ -1 +1 @@
-/trunk:1-23343
+/trunk:1-23345

Modified: branches/frame_order_cleanup/version.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/version.py?rev=23346&r1=23345&r2=23346&view=diff
==============================================================================
--- branches/frame_order_cleanup/version.py     (original)
+++ branches/frame_order_cleanup/version.py     Thu May 22 18:21:16 2014
@@ -75,6 +75,11 @@
     if not pipe.stderr.readlines():
         # Loop over the output lines.
         for line in pipe.stdout.readlines():
+            # Decode Python 3 byte arrays.
+            if hasattr(line, 'decode'):
+                line = line.decode()
+
+            # The revision.
             if search('^[0-9]', line):
                 return str(line[:-1])
 
@@ -111,12 +116,21 @@
                 return str(row[1])
 
     # Try git-svn, reading the output if there are no errors.
-    pipe = Popen('git svn info --url', shell=True, stdin=PIPE, stdout=PIPE, 
stderr=PIPE, close_fds=False)
+    print 'cd %s; git svn info' % status.install_path
+    pipe = Popen('cd %s; git svn info' % status.install_path, shell=True, 
stdin=PIPE, stdout=PIPE, stderr=PIPE, close_fds=False)
     if not pipe.stderr.readlines():
         # Loop over the output lines.
         for line in pipe.stdout.readlines():
-            if search('^svn', line):
-                return str(line[:-1])
+            # Decode Python 3 byte arrays.
+            if hasattr(line, 'decode'):
+                line = line.decode()
+
+            # Split up the line.
+            row = line.split()
+
+            # The revision.
+            if len(row) and row[0] == 'URL:':
+                return str(row[1])
 
 
 def version_full():




Related Messages


Powered by MHonArc, Updated Thu May 22 18:40:02 2014