Skip to content

Commit 2667cb8

Browse files
authored
Merge pull request #226 from edgardmessias/ignore_externals
Added option to ignore externals on update (Close #210)
2 parents 3d3012b + 78385d3 commit 2667cb8

File tree

5 files changed

+24
-7
lines changed

5 files changed

+24
-7
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,4 @@ Example:
109109
|`svn.log.length`|Number of commit messages to log|`50`|
110110
|`svn.showOutput`|Show the output window when the extension starts|`false`|
111111
|`svn.conflicts.autoResolve`|Set file to status resolved after fix conflictss|`false`|
112+
|`svn.update.ignoreExternals`|Set to ignore externals definitions on update (add --ignore-externals)|`true`|

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,11 @@
596596
"type": "boolean",
597597
"description": "Set file to status resolved after fix conflictss",
598598
"default": false
599+
},
600+
"svn.update.ignoreExternals": {
601+
"type": "boolean",
602+
"description": "Set to ignore externals definitions on update (add --ignore-externals)",
603+
"default": true
599604
}
600605
}
601606
}

src/commands.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export class SvnCommands implements IDisposable {
132132
value: repository.username
133133
});
134134

135-
if(username === undefined) {
135+
if (username === undefined) {
136136
return false;
137137
}
138138

@@ -142,7 +142,7 @@ export class SvnCommands implements IDisposable {
142142
password: true
143143
});
144144

145-
if(username === undefined) {
145+
if (username === undefined) {
146146
return false;
147147
}
148148

@@ -685,7 +685,12 @@ export class SvnCommands implements IDisposable {
685685
@command("svn.update", { repository: true })
686686
async update(repository: Repository) {
687687
try {
688-
const result = await repository.updateRevision();
688+
const ignoreExternals = configuration.get<boolean>(
689+
"ignoreExternals",
690+
false
691+
);
692+
693+
const result = await repository.updateRevision(ignoreExternals);
689694
window.showInformationMessage(result);
690695
} catch (error) {
691696
console.error(error);

src/repository.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -638,9 +638,9 @@ export class Repository {
638638
});
639639
}
640640

641-
async updateRevision(): Promise<string> {
641+
async updateRevision(ignoreExternals: boolean = false): Promise<string> {
642642
return await this.run<string>(Operation.Update, async () => {
643-
const response = await this.repository.update();
643+
const response = await this.repository.update(ignoreExternals);
644644
this.updateNewCommits();
645645
return response;
646646
});

src/svnRepository.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,14 @@ export class Repository {
294294
return result.stdout;
295295
}
296296

297-
async update(): Promise<string> {
298-
const result = await this.exec(["update"]);
297+
async update(ignoreExternals: boolean = true): Promise<string> {
298+
const args = ["update"];
299+
300+
if (ignoreExternals) {
301+
args.push("--ignore-externals");
302+
}
303+
304+
const result = await this.exec(args);
299305

300306
this.resetInfo();
301307

0 commit comments

Comments
 (0)