mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-01-16 01:25:42 -05:00
Adds paging support to repo/file history quick picks (wip)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
'use strict';
|
||||
import Git, { GitBlameFormat, GitCommit, IGitAuthor, IGitBlame, IGitCommitLine, IGitEnricher } from './../git';
|
||||
import { Git, GitBlameFormat, GitCommit, IGitAuthor, IGitBlame, IGitCommitLine, IGitEnricher } from './../git';
|
||||
import * as moment from 'moment';
|
||||
import * as path from 'path';
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
'use strict';
|
||||
import Git, { GitFileStatus, GitLogCommit, GitLogType, IGitAuthor, IGitEnricher, IGitLog } from './../git';
|
||||
import { Git, GitFileStatus, GitLogCommit, GitLogType, IGitAuthor, IGitEnricher, IGitLog } from './../git';
|
||||
// import { Logger } from '../../logger';
|
||||
import * as moment from 'moment';
|
||||
import * as path from 'path';
|
||||
|
||||
@@ -151,7 +152,7 @@ export class GitLogParserEnricher implements IGitEnricher<IGitLog> {
|
||||
return entries;
|
||||
}
|
||||
|
||||
enrich(data: string, type: GitLogType, fileNameOrRepoPath: string, isRepoPath: boolean = false): IGitLog {
|
||||
enrich(data: string, type: GitLogType, fileNameOrRepoPath: string, maxCount: number | undefined, isRepoPath: boolean = false): IGitLog {
|
||||
const entries = this._parseEntries(data, isRepoPath);
|
||||
if (!entries) return undefined;
|
||||
|
||||
@@ -199,6 +200,9 @@ export class GitLogParserEnricher implements IGitEnricher<IGitLog> {
|
||||
|
||||
commits.set(entry.sha, commit);
|
||||
}
|
||||
// else {
|
||||
// Logger.log(`merge commit? ${entry.sha}`);
|
||||
// }
|
||||
|
||||
if (recentCommit) {
|
||||
recentCommit.previousSha = commit.sha;
|
||||
@@ -230,7 +234,9 @@ export class GitLogParserEnricher implements IGitEnricher<IGitLog> {
|
||||
repoPath: repoPath,
|
||||
authors: sortedAuthors,
|
||||
// commits: sortedCommits,
|
||||
commits: commits
|
||||
commits: commits,
|
||||
maxCount: maxCount,
|
||||
truncated: maxCount && entries.length >= maxCount
|
||||
} as IGitLog;
|
||||
}
|
||||
}
|
||||
@@ -40,7 +40,7 @@ export const GitBlameFormat = {
|
||||
porcelain: '--porcelain' as GitBlameFormat
|
||||
};
|
||||
|
||||
export default class Git {
|
||||
export class Git {
|
||||
|
||||
static normalizePath(fileName: string, repoPath?: string) {
|
||||
return fileName.replace(/\\/g, '/');
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
import { Uri } from 'vscode';
|
||||
import Git from './git';
|
||||
import { Git } from './git';
|
||||
import * as path from 'path';
|
||||
|
||||
export interface IGitEnricher<T> {
|
||||
@@ -171,6 +171,9 @@ export interface IGitLog {
|
||||
repoPath: string;
|
||||
authors: Map<string, IGitAuthor>;
|
||||
commits: Map<string, GitLogCommit>;
|
||||
|
||||
maxCount: number | undefined;
|
||||
truncated: boolean;
|
||||
}
|
||||
|
||||
export declare type GitFileStatus = '?' | 'A' | 'C' | 'D' | 'M' | 'R' | 'U';
|
||||
|
||||
Reference in New Issue
Block a user