Skip to content

Commit 4f96be4

Browse files
authored
Merge pull request #142 from johnjacobkenny/cleanupNewsCommit
Refactor code to say newCommits
2 parents 3ef843a + e492467 commit 4f96be4

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

src/repository.ts

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export class Repository {
124124
public statusExternal: IFileStatus[] = [];
125125
private disposables: Disposable[] = [];
126126
public currentBranch = "";
127-
public newsCommit: number = 0;
127+
public newCommit: number = 0;
128128

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

140-
private _onDidChangeNewsCommit = new EventEmitter<void>();
141-
readonly onDidChangeNewsCommit: Event<void> = this._onDidChangeNewsCommit
142-
.event;
140+
private _onDidChangeNewCommit = new EventEmitter<void>();
141+
readonly onDidChangeNewCommit: Event<void> = this._onDidChangeNewCommit.event;
143142

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

270269
const svnConfig = workspace.getConfiguration("svn");
271-
272-
const updateFreqNews = svnConfig.get<number>("svn.newsCommits.update");
273-
if (updateFreqNews) {
270+
271+
const updateFreqNew = svnConfig.get<number>("svn.newCommits.update");
272+
if (updateFreqNew) {
274273
const interval = setInterval(() => {
275-
this.updateNewsCommits();
276-
}, 1000 * 60 * updateFreqNews);
274+
this.updateNewCommits();
275+
}, 1000 * 60 * updateFreqNew);
277276

278277
this.disposables.push(
279278
toDisposable(() => {
@@ -282,16 +281,16 @@ export class Repository {
282281
);
283282
}
284283

285-
this.updateNewsCommits();
284+
this.updateNewCommits();
286285
this.status();
287286
}
288287

289288
@debounce(1000)
290-
async updateNewsCommits() {
291-
const newsCommit = await this.repository.countNewsCommit();
292-
if (newsCommit !== this.newsCommit) {
293-
this.newsCommit = newsCommit;
294-
this._onDidChangeNewsCommit.fire();
289+
async updateNewCommits() {
290+
const newCommits = await this.repository.countNewCommits();
291+
if (newCommits !== this.newCommits) {
292+
this.newCommits = newCommits;
293+
this._onDidChangeNewCommits.fire();
295294
}
296295
}
297296

@@ -538,7 +537,7 @@ export class Repository {
538537
async branch(name: string) {
539538
return await this.run(Operation.NewBranch, async () => {
540539
await this.repository.branch(name);
541-
this.updateNewsCommits();
540+
this.updateNewCommits();
542541
});
543542
}
544543

src/statusBar.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export class SvnStatusBar {
2222
this._onDidChange,
2323
this.disposables
2424
);
25+
2526
repository.onDidChangeOperations(
2627
this._onDidChange.fire,
2728
this._onDidChange,
@@ -47,7 +48,7 @@ export class SvnStatusBar {
4748
const title = !isIdle
4849
? "Running"
4950
: this.repository.newsCommit > 0
50-
? `${this.repository.newsCommit} news commits`
51+
? `${this.repository.newCommit} new commits`
5152
: "Updated";
5253

5354
result.push({

src/svnRepository.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ export class Repository {
327327
return result.stdout;
328328
}
329329

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

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

0 commit comments

Comments
 (0)