Skip to content

Commit eb95d14

Browse files
committed
updated changelog and added update command
1 parent b2e5816 commit eb95d14

File tree

6 files changed

+64
-22
lines changed

6 files changed

+64
-22
lines changed

CHANGELOG.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,20 @@
22

33
## What's New
44

5-
* @edgardmessias Added support to configure non-standard layout. To configure, edit the options:
6-
* "svn.layout.trunk" : Relative path for 'trunk' in SVN URL, 'null' to disable. (Ex.: 'trunk', 'main')
7-
* "svn.layout.branches" : Relative path for 'branches' in SVN URL, 'null' to disable. (Ex.: 'branches', 'versions')
8-
* "svn.layout.tags" : Relative path for 'tags' in SVN URL, 'null' to disable. (Ex.: 'tags', 'stamps')
9-
* @edgardmessias Added support to configure diff changes. To configure, edit the options:
10-
* "svn.diff.withHead" : Show diff changes using latest revision in the repository. Set false to use latest revision in local folder
5+
* @edgardmessias Added support to configure non-standard layout. To configure,
6+
edit the options:
7+
* "svn.layout.trunk" : Relative path for 'trunk' in SVN URL, 'null' to
8+
disable. (Ex.: 'trunk', 'main')
9+
* "svn.layout.branches" : Relative path for 'branches' in SVN URL, 'null' to
10+
disable. (Ex.: 'branches', 'versions')
11+
* "svn.layout.tags" : Relative path for 'tags' in SVN URL, 'null' to disable.
12+
(Ex.: 'tags', 'stamps')
13+
* @edgardmessias Added support to configure diff changes. To configure, edit the
14+
options:
15+
* "svn.diff.withHead" : Show diff changes using latest revision in the
16+
repository. Set false to use latest revision in local folder
17+
* @JohnstonCode Commit info message now show what revision it was
18+
* @JohnstonCode Added svn update to scm title commands
1119

1220
## Bug Fixes
1321

package.json

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@
7777
"command": "svn.revert",
7878
"title": "Revert Selected",
7979
"category": "SVN"
80+
},
81+
{
82+
"command": "svn.update",
83+
"title": "Svn update",
84+
"category": "SVN"
8085
}
8186
],
8287
"menus": {
@@ -90,6 +95,10 @@
9095
{
9196
"command": "svn.switchBranch",
9297
"when": "config.svn.enabled"
98+
},
99+
{
100+
"command": "svn.update",
101+
"when": "config.svn.enabled"
93102
}
94103
],
95104
"scm/resourceGroup/context": [],
@@ -133,22 +142,26 @@
133142
},
134143
"svn.diff.withHead": {
135144
"type": "boolean",
136-
"description": "Show diff changes using latest revision in the repository. Set false to use latest revision in local folder",
145+
"description":
146+
"Show diff changes using latest revision in the repository. Set false to use latest revision in local folder",
137147
"default": true
138148
},
139149
"svn.layout.trunk": {
140150
"type": ["string", "null"],
141-
"description": "Relative path for 'trunk' in SVN URL, 'null' to disable. (Ex.: 'trunk', 'main')",
151+
"description":
152+
"Relative path for 'trunk' in SVN URL, 'null' to disable. (Ex.: 'trunk', 'main')",
142153
"default": "trunk"
143154
},
144155
"svn.layout.branches": {
145156
"type": ["string", "null"],
146-
"description": "Relative path for 'branches' in SVN URL, 'null' to disable. (Ex.: 'branches', 'versions')",
157+
"description":
158+
"Relative path for 'branches' in SVN URL, 'null' to disable. (Ex.: 'branches', 'versions')",
147159
"default": "branches"
148160
},
149161
"svn.layout.tags": {
150162
"type": ["string", "null"],
151-
"description": "Relative path for 'tags' in SVN URL, 'null' to disable. (Ex.: 'tags', 'stamps')",
163+
"description":
164+
"Relative path for 'tags' in SVN URL, 'null' to disable. (Ex.: 'tags', 'stamps')",
152165
"default": "tags"
153166
}
154167
}

src/commands.ts

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
TextDocumentShowOptions,
77
QuickPickItem
88
} from "vscode";
9-
import { inputCommitMessage, changesCommitted } from "./messages";
9+
import { inputCommitMessage } from "./messages";
1010
import { Svn } from "./svn";
1111
import { Model } from "./model";
1212
import { Repository } from "./repository";
@@ -158,9 +158,7 @@ export class SvnCommands {
158158
message,
159159
filePaths
160160
);
161-
window.showInformationMessage(
162-
result.match(/Committed revision (.*)\./i)[0]
163-
);
161+
window.showInformationMessage(result);
164162
repository.inputBox.value = "";
165163
repository.update();
166164
} catch (error) {
@@ -198,9 +196,7 @@ export class SvnCommands {
198196
}
199197

200198
const result = await repository.repository.commitFiles(message, paths);
201-
window.showInformationMessage(
202-
result.match(/Committed revision (.*)\./i)[0]
203-
);
199+
window.showInformationMessage(result);
204200
repository.update();
205201
} catch (error) {
206202
console.error(error);
@@ -320,4 +316,15 @@ export class SvnCommands {
320316
window.showErrorMessage("Unable to revert");
321317
}
322318
}
319+
320+
@command("svn.update", { repository: true })
321+
async update(repository: Repository) {
322+
try {
323+
const result = await repository.repository.update();
324+
window.showInformationMessage(result);
325+
} catch (error) {
326+
console.error(error);
327+
window.showErrorMessage("Unable to update");
328+
}
329+
}
323330
}

src/messages.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,3 @@ export function inputCommitMessage(message?: string) {
2121
.then(string => resolve(string));
2222
});
2323
}
24-
25-
export function changesCommitted() {
26-
return window.showInformationMessage("Files Committed");
27-
}

src/svn.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,4 +234,8 @@ export class Svn {
234234

235235
return this.exec("", args);
236236
}
237+
238+
update(root: string) {
239+
return this.exec(root, ["update"]);
240+
}
237241
}

src/svnRepository.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ export class Repository {
4545
throw new Error(result.stderr);
4646
}
4747

48-
return result.stdout;
48+
const outputMessage = result.stdout.match(/Committed revision (.*)\./i)[0];
49+
50+
return outputMessage;
4951
}
5052

5153
addFile(filePath: string) {
@@ -216,4 +218,16 @@ export class Repository {
216218

217219
return result.stdout;
218220
}
221+
222+
async update() {
223+
const result = await this.svn.update(this.root);
224+
225+
if (result.exitCode !== 0) {
226+
throw new Error(result.stderr);
227+
}
228+
229+
const message = result.stdout.match(/At revision (.*)\./i)[0];
230+
231+
return message;
232+
}
219233
}

0 commit comments

Comments
 (0)