Skip to content

Commit b2e5816

Browse files
committed
commiting files now shows the revision message rather than generic one
1 parent 673411e commit b2e5816

File tree

2 files changed

+21
-11
lines changed

2 files changed

+21
-11
lines changed

src/commands.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,14 @@ export class SvnCommands {
154154
});
155155

156156
try {
157-
await repository.repository.commitFiles(message, filePaths);
157+
const result = await repository.repository.commitFiles(
158+
message,
159+
filePaths
160+
);
161+
window.showInformationMessage(
162+
result.match(/Committed revision (.*)\./i)[0]
163+
);
158164
repository.inputBox.value = "";
159-
changesCommitted();
160165
repository.update();
161166
} catch (error) {
162167
console.error(error);
@@ -182,7 +187,6 @@ export class SvnCommands {
182187

183188
@command("svn.commit", { repository: true })
184189
async commit(repository: Repository, ...args: any[][]): Promise<void> {
185-
console.log(args);
186190
try {
187191
const paths = args[0].map(state => {
188192
return state.resourceUri.fsPath;
@@ -193,8 +197,10 @@ export class SvnCommands {
193197
return;
194198
}
195199

196-
await repository.repository.commitFiles(message, paths);
197-
changesCommitted();
200+
const result = await repository.repository.commitFiles(message, paths);
201+
window.showInformationMessage(
202+
result.match(/Committed revision (.*)\./i)[0]
203+
);
198204
repository.update();
199205
} catch (error) {
200206
console.error(error);

src/svnRepository.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ export class Repository {
2424
return status;
2525
}
2626

27-
async show(path: string, revision?: string, options: CpOptions = {}): Promise<string> {
27+
async show(
28+
path: string,
29+
revision?: string,
30+
options: CpOptions = {}
31+
): Promise<string> {
2832
const result = await this.svn.show(path, revision, options);
2933

3034
if (result.exitCode !== 0) {
@@ -68,8 +72,10 @@ export class Repository {
6872
const branchesLayout = config.get<string>("layout.branches");
6973
const tagsLayout = config.get<string>("layout.tags");
7074

71-
const trees = [trunkLayout, branchesLayout, tagsLayout].filter(x => x != null);
72-
const regex = new RegExp("<url>(.*?)\/(" + trees.join("|") + ").*?<\/url>");
75+
const trees = [trunkLayout, branchesLayout, tagsLayout].filter(
76+
x => x != null
77+
);
78+
const regex = new RegExp("<url>(.*?)/(" + trees.join("|") + ").*?</url>");
7379

7480
const info = await this.svn.info(this.root);
7581

@@ -171,9 +177,7 @@ export class Repository {
171177
const repoUrl = await this.getRepoUrl();
172178
const newBranch = repoUrl + "/" + branchesLayout + "/" + name;
173179
const resultBranch = await this.svn.info(this.root);
174-
const currentBranch = resultBranch.stdout
175-
.match(/<url>(.*?)<\/url>/)[1];
176-
180+
const currentBranch = resultBranch.stdout.match(/<url>(.*?)<\/url>/)[1];
177181
const result = await this.svn.copy(currentBranch, newBranch, name);
178182

179183
if (result.exitCode !== 0) {

0 commit comments

Comments
 (0)