[svn r57474] Fixed bug reported by Martijn Faassen - when the XML output of 'svn st --xml'
didn't contain author information, the code raised an exception. --HG-- branch : trunk
This commit is contained in:
parent
620805c4d2
commit
c32fa7b4f3
|
@ -1,7 +1,7 @@
|
||||||
import py
|
import py
|
||||||
import sys
|
import sys
|
||||||
from py.__.path.svn.testing.svntestbase import CommonSvnTests, getrepowc
|
from py.__.path.svn.testing.svntestbase import CommonSvnTests, getrepowc
|
||||||
from py.__.path.svn.wccommand import InfoSvnWCCommand
|
from py.__.path.svn.wccommand import InfoSvnWCCommand, XMLWCStatus
|
||||||
from py.__.path.svn.wccommand import parse_wcinfotime
|
from py.__.path.svn.wccommand import parse_wcinfotime
|
||||||
from py.__.path.svn import svncommon
|
from py.__.path.svn import svncommon
|
||||||
from py.__.conftest import option
|
from py.__.conftest import option
|
||||||
|
@ -214,6 +214,19 @@ class TestWCSvnCommandPath(CommonSvnTests):
|
||||||
assert 'deletefile' not in s.unchanged
|
assert 'deletefile' not in s.unchanged
|
||||||
assert [x.basename for x in s.deleted] == ['deletefile']
|
assert [x.basename for x in s.deleted] == ['deletefile']
|
||||||
|
|
||||||
|
def test_status_noauthor(self):
|
||||||
|
# testing for XML without author - this used to raise an exception
|
||||||
|
xml = '''\
|
||||||
|
<entry path="/tmp/pytest-23/wc">
|
||||||
|
<wc-status item="normal" props="none" revision="0">
|
||||||
|
<commit revision="0">
|
||||||
|
<date>2008-08-19T16:50:53.400198Z</date>
|
||||||
|
</commit>
|
||||||
|
</wc-status>
|
||||||
|
</entry>
|
||||||
|
'''
|
||||||
|
XMLWCStatus.fromstring(xml, self.root)
|
||||||
|
|
||||||
def test_diff(self):
|
def test_diff(self):
|
||||||
p = self.root / 'anotherfile'
|
p = self.root / 'anotherfile'
|
||||||
out = p.diff(rev=2)
|
out = p.diff(rev=2)
|
||||||
|
|
|
@ -684,9 +684,10 @@ class XMLWCStatus(WCStatus):
|
||||||
if commitel:
|
if commitel:
|
||||||
modrev = commitel.getAttribute('revision')
|
modrev = commitel.getAttribute('revision')
|
||||||
author = ''
|
author = ''
|
||||||
for c in commitel.getElementsByTagName('author')[0]\
|
author_els = commitel.getElementsByTagName('author')
|
||||||
.childNodes:
|
if author_els:
|
||||||
author += c.nodeValue
|
for c in author_els[0].childNodes:
|
||||||
|
author += c.nodeValue
|
||||||
date = ''
|
date = ''
|
||||||
for c in commitel.getElementsByTagName('date')[0]\
|
for c in commitel.getElementsByTagName('date')[0]\
|
||||||
.childNodes:
|
.childNodes:
|
||||||
|
|
Loading…
Reference in New Issue