Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 15 additions & 16 deletions src/repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export class Repository {
public statusExternal: IFileStatus[] = [];
private disposables: Disposable[] = [];
public currentBranch = "";
public newsCommit: number = 0;
public newCommit: number = 0;

private _onDidChangeRepository = new EventEmitter<Uri>();
readonly onDidChangeRepository: Event<Uri> = this._onDidChangeRepository
Expand All @@ -137,9 +137,8 @@ export class Repository {
private _onDidChangeStatus = new EventEmitter<void>();
readonly onDidChangeStatus: Event<void> = this._onDidChangeStatus.event;

private _onDidChangeNewsCommit = new EventEmitter<void>();
readonly onDidChangeNewsCommit: Event<void> = this._onDidChangeNewsCommit
.event;
private _onDidChangeNewCommit = new EventEmitter<void>();
readonly onDidChangeNewCommit: Event<void> = this._onDidChangeNewCommit.event;

private _onRunOperation = new EventEmitter<Operation>();
readonly onRunOperation: Event<Operation> = this._onRunOperation.event;
Expand Down Expand Up @@ -268,12 +267,12 @@ export class Repository {
this.disposables.push(this.conflicts);

const svnConfig = workspace.getConfiguration("svn");

const updateFreqNews = svnConfig.get<number>("svn.newsCommits.update");
if (updateFreqNews) {
const updateFreqNew = svnConfig.get<number>("svn.newCommits.update");
if (updateFreqNew) {
const interval = setInterval(() => {
this.updateNewsCommits();
}, 1000 * 60 * updateFreqNews);
this.updateNewCommits();
}, 1000 * 60 * updateFreqNew);

this.disposables.push(
toDisposable(() => {
Expand All @@ -282,16 +281,16 @@ export class Repository {
);
}

this.updateNewsCommits();
this.updateNewCommits();
this.status();
}

@debounce(1000)
async updateNewsCommits() {
const newsCommit = await this.repository.countNewsCommit();
if (newsCommit !== this.newsCommit) {
this.newsCommit = newsCommit;
this._onDidChangeNewsCommit.fire();
async updateNewCommits() {
const newCommits = await this.repository.countNewCommits();
if (newCommits !== this.newCommits) {
this.newCommits = newCommits;
this._onDidChangeNewCommits.fire();
}
}

Expand Down Expand Up @@ -538,7 +537,7 @@ export class Repository {
async branch(name: string) {
return await this.run(Operation.NewBranch, async () => {
await this.repository.branch(name);
this.updateNewsCommits();
this.updateNewCommits();
});
}

Expand Down
3 changes: 2 additions & 1 deletion src/statusBar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export class SvnStatusBar {
this._onDidChange,
this.disposables
);

repository.onDidChangeOperations(
this._onDidChange.fire,
this._onDidChange,
Expand All @@ -47,7 +48,7 @@ export class SvnStatusBar {
const title = !isIdle
? "Running"
: this.repository.newsCommit > 0
? `${this.repository.newsCommit} news commits`
? `${this.repository.newCommit} new commits`
: "Updated";

result.push({
Expand Down
2 changes: 1 addition & 1 deletion src/svnRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ export class Repository {
return result.stdout;
}

async countNewsCommit(revision: string = "BASE:HEAD") {
async countNewCommit(revision: string = "BASE:HEAD") {
const result = await this.exec(["log", "-r", revision, "-q", "--xml"]);

const matches = result.stdout.match(/<logentry/g);
Expand Down