-
Notifications
You must be signed in to change notification settings - Fork 451
Add ability to include/exclude changes #101
Conversation
Also provided Refresh in context menu Removed ExcludeAll/IncludeAll
src/extension.ts
Outdated
context.subscriptions.push(commands.registerCommand(TfvcCommandNames.IncludeAll, () => _extensionManager.Tfvc.TfvcIncludeAll())); | ||
})); | ||
context.subscriptions.push(commands.registerCommand(TfvcCommandNames.Exclude, (...args) => { | ||
if (args) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since most commands will need this logic, it would be nice to somehow push this into a helper method. Not sure if that is easy or not.
src/tfvc/commands/add.ts
Outdated
let line: string = lines[index]; | ||
if (this.isFilePath(line)) { | ||
path = line; | ||
} else if (line) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line can't be empty here since you excluded them in the split above.
src/tfvc/tfvc-extension.ts
Outdated
//At this point, an unversioned file could be a candidate file, so call Add. Once it is added, it should be a Pending change. | ||
if (!resource.IsVersioned) { | ||
await this._repo.Add([path]); | ||
//Even if adding a file, Unexclude it (it may have been excluded previously) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comments are a bit confusing. Looks like you used to have an else clause here and then removed it.
src/tfvc/tfvcscmprovider.ts
Outdated
}; | ||
|
||
public static async Refresh(): Promise<void> { | ||
const tfvcProvider: TfvcSCMProvider = TfvcSCMProvider.instance; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like we are reusing this invalid state check a lot. Consider refactoring it into it's own method that gets the scm provider.
src/tfvc/scm/model.ts
Outdated
//Add the item to the explicitly excluded list. | ||
public async Exclude(path: string): Promise<void> { | ||
if (path) { | ||
if (!_.contains(this._explicitlyExcluded, path)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this contains case insensitive? It probably should be.
src/tfvc/scm/model.ts
Outdated
//Unexclude doesn't explicitly INclude. It defers to the status of the individual item. | ||
public async Unexclude(path: string): Promise<void> { | ||
if (path) { | ||
if (_.contains(this._explicitlyExcluded, path)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Case insensitive?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments, but nothing that's a real problem.
Also provided Refresh in context menu
Removed ExcludeAll/IncludeAll