mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-27 16:38:50 +02:00
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:
parent
8529a3aac7
commit
b9f8e19162
4 changed files with 49 additions and 51 deletions
|
@ -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);
|
||||
}
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue