/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Member Functions | Properties | Private Member Functions | Static Private Attributes
DybPython::svndiff::SVN Class Reference
Inheritance diagram for DybPython::svndiff::SVN:
Inheritance graph
[legend]
Collaboration diagram for DybPython::svndiff::SVN:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def pipecall
def filecall
def __call__

Properties

 cmd = property(__cmd )
 msg = property(lambda self:self.get("msg","naughty-no-msg") )
 author = property(lambda self:self.get("author","no-author") )
 changed = property(_changed )
 diff = property(lambda self:self(cmd="diff") )

Private Member Functions

def __cmd
def _changed

Static Private Attributes

string _cmd = "%(exepath)s %(creds)s %(opt)s %(cmd)s %(path)s "
string _cmdr = " --revision %(revision)s "

Detailed Description

Definition at line 79 of file svndiff.py.


Constructor & Destructor Documentation

def DybPython::svndiff::SVN::__init__ (   self,
  args,
  kwargs 
)

Reimplemented from DybPython::svndiff::Cmd.

Definition at line 121 of file svndiff.py.

00122                                        :
00123         Cmd.__init__(self,*args,**kwargs)
00124         self['exepath']=os.environ.get("SVN", "svn")
00125         self['opt']=""  ## overidden later
00126         self['creds']=kwargs.get("creds", "" )   
00127         path = self.get('path',None)
00128         assert path, "SVN a path argument is required "
00129         if path.startswith('http'):
00130             pass
00131         else: 
00132             self['path'] = os.path.expanduser( self['path'] )
00133             assert os.path.isdir( os.path.join( self['path'], ".svn"  )), "Directory %r is not SVN working copy " % self


Member Function Documentation

def DybPython::svndiff::SVN::__cmd (   self) [private]

Definition at line 82 of file svndiff.py.

00083                    :
00084         if self.get('revision',None):
00085             return self._cmdr % self
00086         else:
            return self._cmd % self
def DybPython::svndiff::SVN::_changed (   self) [private]
List of full repository paths changed in the specified revision

Definition at line 91 of file svndiff.py.

00092                       :
00093         """
00094         List of full repository paths changed in the specified revision
00095         """
00096         c = []
00097         pthl = False
00098         for i,line in enumerate(self(cmd="log",opt="--verbose --non-interactive").rstrip().split("\n")):
00099             if pthl:
00100                 ele = line.split()              
00101             else:
00102                 ele = []
00103             if line=="Changed paths:":
00104                 pthl = True
00105             elif line=="":
00106                 pthl = False
00107             else:
00108                 pass
00109             if len(ele)==2:
00110                 path = ele[1]
00111                 if path[0]=='/':
00112                     path = path[1:]
00113                 c.append(path)       
00114             elif len(ele)==0:
00115                 pass
00116             else:
00117                 print "SVN._changed unexpected [%-2d][%s][%s][%r]" % (i,pthl,line,ele)
        return c 
def DybPython::svndiff::Cmd::pipecall (   self) [inherited]

Definition at line 43 of file svndiff.py.

00044                       :
00045         p = os.popen( self.cmd )
00046         s = p.read()
00047         rc = p.close()
00048         assert rc == 0 or rc == None, "pipecall rc %s failed %s " % ( rc, self.cmd )
00049         return s

def DybPython::svndiff::Cmd::filecall (   self) [inherited]
Run command and return output as string, useful for debugging

This was helpful in determining svnlook segmenting (the resulting /tmp/cmd.txt is same as prior /tmp/diff.txt)::

    running cmd /data/env/system/svn/subversion-1.4.0/bin/svnlook log /var/scm/repos/newtest  --transaction 15-1  
    sh: line 1: 20450 Segmentation fault      /data/env/system/svn/subversion-1.4.0/bin/svnlook diff /var/scm/repos/newtest --transaction 15-1 >/tmp/cmd.txt

suspect that a former backout merge was implicated in the segmentation fault ::

      svn merge -c -14 

as after ``svn rm tmp_offline_db`` and recreating with a new rdumpcat the segmentation 
fault goes away  

Definition at line 50 of file svndiff.py.

00051                       :
00052         """
00053         Run command and return output as string, useful for debugging
00054 
00055         This was helpful in determining svnlook segmenting (the resulting /tmp/cmd.txt is same as prior /tmp/diff.txt)::
00056 
00057             running cmd /data/env/system/svn/subversion-1.4.0/bin/svnlook log /var/scm/repos/newtest  --transaction 15-1  
00058             sh: line 1: 20450 Segmentation fault      /data/env/system/svn/subversion-1.4.0/bin/svnlook diff /var/scm/repos/newtest --transaction 15-1 >/tmp/cmd.txt
00059 
00060         suspect that a former backout merge was implicated in the segmentation fault ::
00061 
00062               svn merge -c -14 
00063 
00064         as after ``svn rm tmp_offline_db`` and recreating with a new rdumpcat the segmentation 
00065         fault goes away  
00066         """
00067         out = tempfile.NamedTemporaryFile()
00068         tmp = "/tmp/dbsvn-%s.txt" % os.getpid()
00069         rc = os.system( "%s > %s " % (self.cmd, tmp) ) 
00070         assert rc == 0, "filecall rc %s failed %s while writing %s " % ( rc, self.cmd, tmp )
00071         s = open(tmp).read()
00072         if os.path.exists(tmp):
00073             os.remove(tmp)
00074         return s

def DybPython::svndiff::Cmd::__call__ (   self,
  args,
  kwargs 
) [inherited]

Definition at line 75 of file svndiff.py.

00076                                        :
00077         self.update( kwargs )
00078         return self.pipecall()


Member Data Documentation

string DybPython::svndiff::SVN::_cmd = "%(exepath)s %(creds)s %(opt)s %(cmd)s %(path)s " [static, private]

Definition at line 80 of file svndiff.py.

string DybPython::svndiff::SVN::_cmdr = " --revision %(revision)s " [static, private]

Definition at line 81 of file svndiff.py.


Property Documentation

DybPython::svndiff::SVN::cmd = property(__cmd ) [static]

Reimplemented from DybPython::svndiff::Cmd.

Definition at line 87 of file svndiff.py.

DybPython::svndiff::SVN::msg = property(lambda self:self.get("msg","naughty-no-msg") ) [static]

Definition at line 88 of file svndiff.py.

DybPython::svndiff::SVN::author = property(lambda self:self.get("author","no-author") ) [static]

Definition at line 89 of file svndiff.py.

DybPython::svndiff::SVN::changed = property(_changed ) [static]

Definition at line 118 of file svndiff.py.

DybPython::svndiff::Cmd::diff = property(lambda self:self(cmd="diff") ) [static, inherited]

Definition at line 39 of file svndiff.py.


The documentation for this class was generated from the following file:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 09:55:41 for DybPython by doxygen 1.7.4