Ticket #111 (closed defect: worksforme)
Xml parse exception because of magic-looking string in patch name
| Reported by: | zooko | Owned by: | lele |
|---|---|---|---|
| Priority: | major | Milestone: | VersionOne |
| Component: | darcs | Version: | 0.8 |
| Keywords: | Cc: | zooko@… |
Description
I'm using a truly ancient version of tailor, so this bug report might be useless for the current version, but I'm submitting it anyway in case it turns out that the same bug exists in the current version. For reference, the most recent patch from lele that I have in my copy of tailor here is this one:
Thu Aug 4 10:09:44 PDT 2005 lele@…
- Handle the case when there is no author name The author name may be missing from the set of information that the source backend collects from the upstream repository, and that, at least for Subversion, means that the commit was made by an anonymous user.
Here's the bug. Somebody committed a patch with this name "Use ${root} to find pyopts file.". Now when I try to tailorize that darcs patch into Subversion, I get this exception:
zooko@hanford:/home/darcs/trunk-tailorizer$ tailor.py --dont-refill-changelogs --patch-name-format "%(revision)s [from darcs]" .
There are no changes to revert!
Finished reverting.
Fail: Text.Regex.Posix.regcomp: error in pattern
parseString(, <vcpx.darcs.DarcsXMLChangesHandler instance at 0x4044986c>) yielded the following error...
Traceback (most recent call last):
File "/usr/local/bin/tailor.py", line 36, in ?
main()
File "/usr/local/stow/tailor-old-zookopatched//lib/python2.4/site-packages/vcpx/tailor.py", line 654, in main
options.concatenate_logs)
File "/usr/local/stow/tailor-old-zookopatched//lib/python2.4/site-packages/vcpx/tailor.py", line 425, in update
delayed_commit=single_commit)
File "/usr/local/stow/tailor-old-zookopatched//lib/python2.4/site-packages/vcpx/dualwd.py", line 74, in applyUpstreamChangesets
delayed_commit=delayed_commit)
File "/usr/local/stow/tailor-old-zookopatched//lib/python2.4/site-packages/vcpx/source.py", line 90, in applyUpstreamChangesets
res = self._applyChangeset(root, c, logger=logger)
File "/usr/local/stow/tailor-old-zookopatched//lib/python2.4/site-packages/vcpx/darcs.py", line 238, in _applyChangeset
last = changesets_from_darcschanges(c(output=True, patch=patchname))
File "/usr/local/stow/tailor-old-zookopatched//lib/python2.4/site-packages/vcpx/darcs.py", line 144, in changesets_from_darcschanges
raise le
xml.sax._exceptions.SAXParseException: <unknown>:1:0: no element found
Hope this helps!
Change History
comment:2 Changed 6 years ago by lele
Hi Zooko,
any chance of obtaining a copy of the output of
darcs changes -p whatever --xml --summ
I cannot see how that "magic" bit in the name could make the SAX parser to fail...
comment:3 Changed 6 years ago by zooko
zooko@hanford:~/trees/trunk$ P="Use \${root} to find pyopts file."
zooko@hanford:~/trees/trunk$ echo $P
Use ${root} to find pyopts file.
zooko@hanford:~/trees/trunk$ PR=`python -c "import re ; print re.escape(\"${P}\").replace(\"\>\", \">\").replace(\"\<\", \"<\").replace(\"\\\\\'\", \"'\")"`
zooko@hanford:~/trees/trunk$
zooko@hanford:~/trees/trunk$
zooko@hanford:~/trees/trunk$ echo $PR
Use\ \$\{root\}\ to\ find\ pyopts\ file\.
zooko@hanford:~/trees/trunk$ darcs changes -p"${PR}" --xml --summ
<changelog>
<patch author='zandr@allmydata.com' date='20070304195847' local_date='Sun Mar 4 11:58:47 PST 2007' inverted='False' hash='20070304195847-441fa-c412124e2c5c71ac0e0657d819517e9ae12a05fd.gz'>
<name>Use ${root} to find pyopts file.</name>
<summary>
<modify_file>
trunk/bin/allmydata<removed_lines num='2'/><added_lines num='2'/>
</modify_file>
</summary>
</patch>
</changelog>
