/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::SVNLook Class Reference
Inheritance diagram for DybPython::svndiff::SVNLook:
Inheritance graph
[legend]
Collaboration diagram for DybPython::svndiff::SVNLook:
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(cmd="log") )
 author = property(lambda self:self(cmd="author").rstrip() )
 changed = property(_changed )
 diff = property(lambda self:self(cmd="diff") )

Private Member Functions

def __cmd
def _changed

Static Private Attributes

string _cmd = "%(sudo)s%(exepath)s %(cmd)s %(repo_path)s "
string _cmdt = " --transaction %(txn_name)s "
string _cmdr = " --revision %(revision)s "

Detailed Description

Definition at line 134 of file svndiff.py.


Constructor & Destructor Documentation

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

Reimplemented from DybPython::svndiff::Cmd.

Definition at line 165 of file svndiff.py.

00166                                        :
00167         Cmd.__init__(self, *args, **kwargs )
00168         self['exepath']=os.environ.get("SVNLOOK", "svnlook")
00169         self['sudo']=kwargs.get("sudo","")
00170         self['cmd']="to_be_set" 
00171         assert os.path.isdir( os.path.join( self['repo_path'], "hooks" )), "Directory %s is not an SVN repository " % path
00172 


Member Function Documentation

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

Definition at line 138 of file svndiff.py.

00139                    :
00140         if self.get('txn_name',None):
00141             return self._cmdt % self
00142         elif self.get('revision',None):
00143             return self._cmdr % self
00144         else:
            return None
def DybPython::svndiff::SVNLook::_changed (   self) [private]
List of full repository paths changed in the txn or commit

Definition at line 149 of file svndiff.py.

00150                       :
00151         """
00152         List of full repository paths changed in the txn or commit
00153 
00154         """
00155         d = []
00156         for line in self(cmd="changed").rstrip().split("\n"):
00157             ele = line.split()
00158             assert len(ele) == 2 , "SVNLook._changed unexpected ele %r " % ele
00159             #print "[%s][%s]" % ( ele[0], ele[1] )
00160             path = ele[1]
00161             if path[0]=='/':
00162                 path = path[1:]    
00163             d.append(path)
        return d 
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::SVNLook::_cmd = "%(sudo)s%(exepath)s %(cmd)s %(repo_path)s " [static, private]

Definition at line 135 of file svndiff.py.

string DybPython::svndiff::SVNLook::_cmdt = " --transaction %(txn_name)s " [static, private]

Definition at line 136 of file svndiff.py.

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

Definition at line 137 of file svndiff.py.


Property Documentation

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

Reimplemented from DybPython::svndiff::Cmd.

Definition at line 145 of file svndiff.py.

DybPython::svndiff::SVNLook::msg = property(lambda self:self(cmd="log") ) [static]

Definition at line 146 of file svndiff.py.

DybPython::svndiff::SVNLook::author = property(lambda self:self(cmd="author").rstrip() ) [static]

Definition at line 147 of file svndiff.py.

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

Definition at line 164 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