mirror of
https://gitlab.silvrtree.co.uk/martind2000/nci.git
synced 2025-02-11 05:19:18 +00:00
change mercurial separators - fix parsing of multiline comments
This commit is contained in:
parent
ae954308f9
commit
91f8a68f29
@ -15,13 +15,9 @@ inherits(Scm, ParentScm);
|
|||||||
|
|
||||||
Scm.prototype.defaultRev = 'default';
|
Scm.prototype.defaultRev = 'default';
|
||||||
|
|
||||||
// use 2 invisible separators as fields separator
|
Scm.prototype._arraysSeparator = '\u2064' + '\u2064';
|
||||||
Scm.prototype._fieldsSeparator = String.fromCharCode(2063);
|
Scm.prototype._fieldsSeparator = '\u2063' + '\u2063';
|
||||||
Scm.prototype._fieldsSeparator += Scm.prototype._fieldsSeparator;
|
Scm.prototype._linesSeparator = '\u2028' + '\u2028';
|
||||||
|
|
||||||
// use 2 vertical tabs as arrays separator
|
|
||||||
Scm.prototype._arraysSeparator = String.fromCharCode(11);
|
|
||||||
Scm.prototype._arraysSeparator += Scm.prototype._arraysSeparator;
|
|
||||||
|
|
||||||
Scm.prototype._revTemplate = [
|
Scm.prototype._revTemplate = [
|
||||||
'{node|short}',
|
'{node|short}',
|
||||||
@ -94,13 +90,15 @@ Scm.prototype.getChanges = function(rev1, rev2, callback) {
|
|||||||
function() {
|
function() {
|
||||||
self.run({cmd: 'hg', args: [
|
self.run({cmd: 'hg', args: [
|
||||||
'log', '--rev', rev2 + ':' + rev1,
|
'log', '--rev', rev2 + ':' + rev1,
|
||||||
'--template', self._revTemplate + '\n'
|
'--template', self._revTemplate + self._linesSeparator
|
||||||
]}, this.slot());
|
]}, this.slot());
|
||||||
},
|
},
|
||||||
function(err, stdout) {
|
function(err, stdout) {
|
||||||
// always skip last line - it's empty and also skip first
|
// always skip last line - it's empty and also skip first
|
||||||
// rev if we see range
|
// rev if we see range
|
||||||
var rows = stdout.split('\n').slice(0, rev1 === rev2 ? -1 : -2);
|
var rows = stdout.split(self._linesSeparator).slice(
|
||||||
|
0, rev1 === rev2 ? -1 : -2
|
||||||
|
);
|
||||||
|
|
||||||
var changes = _(rows).map(function(str) {
|
var changes = _(rows).map(function(str) {
|
||||||
return self._parseRev(str);
|
return self._parseRev(str);
|
||||||
|
Loading…
Reference in New Issue
Block a user