Implement log using RevisionRange

This changes the implementation of the "log" command to use the RevisionRange
functionality. RevisionRange sorts the results in order of reverse create time,
to match real git. This is a change from the previous implementation of log,
which essentially produced a breadth-first ordering.
This commit is contained in:
David Nelson 2019-04-18 20:57:29 -05:00
parent 8529a3aac7
commit b9f8e19162
4 changed files with 49 additions and 51 deletions

View file

@ -592,19 +592,8 @@ var commandConfig = {
execute: function(engine, command) {
var generalArgs = command.getGeneralArgs();
if (generalArgs.length == 2) {
// do fancy git log branchA ^branchB
if (generalArgs[1][0] == '^') {
engine.logWithout(generalArgs[0], generalArgs[1]);
} else {
throw new GitError({
msg: intl.str('git-error-options')
});
}
}
command.oneArgImpliedHead(generalArgs);
engine.log(generalArgs[0]);
command.impliedHead(generalArgs, 0);
engine.log(generalArgs);
}
},