Indefero

Indefero Commit Details


Date:2010-10-04 10:20:53 (14 years 2 months ago)
Author:Thomas Keller
Branch:develop, feature-issue_links, feature.better-home, feature.content-md5, feature.diff-whitespace, feature.download-md5, feature.issue-links, feature.issue-of-others, feature.issue-summary, feature.search-filter, feature.webrepos, feature.wiki-default-page, master, release-1.1, release-1.2, release-1.3
Commit:90edbf0d8b14c8cf94901688ce0b45af1b5d5019
Parents: 0c575ccc740828d61dd42c5305e61c19e1f1d1df
Message:Tweak the basicio parser so that it properly handles multi-value lines with hashes (lines like symbol [hash] [hash] are still not handled, but aren't outputted from any command either as of now).

Changes:

File differences

src/IDF/Scm/Monotone/BasicIO.php
6868
6969
7070
71
72
71
72
73
74
75
7376
7477
7578
76
79
80
81
7782
7883
7984
8085
8186
87
88
89
90
91
92
93
94
8295
8396
8497
......
87100
88101
89102
90
91
92
93
94
95
96
97
98103
99104
100105
{
unset($stanzaLine['hash']);
$valCount = 0;
while ($in[$pos] == '"') {
++$pos; // opening quote
// if hashs and plain values are encountered in the same
// value list, we add the hash values as simple values as well
while ($in[$pos] == '"' || $in[$pos] == '[') {
$isHashValue = $in[$pos] == '[';
++$pos; // opening quote / bracket
$stanzaLine['values'][$valCount] = '';
while ($pos < $length) {
$ch = $in[$pos]; $pr = $in[$pos-1];
if ($ch == '"' && $pr != '\\') break;
if (($isHashValue && $ch == ']')
||(!$isHashValue && $ch == '"' && $pr != '\\'))
break;
++$pos;
$stanzaLine['values'][$valCount] .= $ch;
}
++$pos; // closing quote
if (!$isHashValue) {
$stanzaLine['values'][$valCount] = str_replace(
array("\\\\", "\\\""),
array("\\", "\""),
$stanzaLine['values'][$valCount]
);
}
if ($pos >= $length)
break;
++$valCount;
}
}
for ($i = 0; $i <= $valCount; $i++) {
$stanzaLine['values'][$i] = str_replace(
array("\\\\", "\\\""),
array("\\", "\""),
$stanzaLine['values'][$i]
);
}
}
$stanza[] = $stanzaLine;

Archive Download the corresponding diff file

Page rendered in 0.09083s using 13 queries.