mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-07-10 06:34:26 +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
|
@ -351,5 +351,29 @@ describe('Git', function() {
|
|||
expect(commandMsg).toContain('Commit: C6\n');
|
||||
});
|
||||
});
|
||||
|
||||
it('multiple included revisions', function() {
|
||||
runCommand(SETUP + 'git log right left', function(commandMsg) {
|
||||
expect(commandMsg).toContain('Commit: C0\n');
|
||||
expect(commandMsg).toContain('Commit: C1\n');
|
||||
expect(commandMsg).toContain('Commit: C2\n');
|
||||
expect(commandMsg).toContain('Commit: C3\n');
|
||||
expect(commandMsg).toContain('Commit: C4\n');
|
||||
expect(commandMsg).toContain('Commit: C5\n');
|
||||
expect(commandMsg).not.toContain('Commit: C6\n');
|
||||
});
|
||||
});
|
||||
|
||||
it('multiple excluded revisions', function() {
|
||||
runCommand(SETUP + 'git log all ^right ^left', function(commandMsg) {
|
||||
expect(commandMsg).not.toContain('Commit: C0\n');
|
||||
expect(commandMsg).not.toContain('Commit: C1\n');
|
||||
expect(commandMsg).not.toContain('Commit: C2\n');
|
||||
expect(commandMsg).not.toContain('Commit: C3\n');
|
||||
expect(commandMsg).not.toContain('Commit: C4\n');
|
||||
expect(commandMsg).not.toContain('Commit: C5\n');
|
||||
expect(commandMsg).toContain('Commit: C6\n');
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue