Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Adding TFVC Undo command #95

Merged
merged 7 commits into from
Feb 9, 2017
Merged

Adding TFVC Undo command #95

merged 7 commits into from
Feb 9, 2017

Conversation

jeffyoung
Copy link
Contributor

No description provided.

@@ -89,6 +89,9 @@ export class CommandHelper {
}
lines = lines.splice(index);
}
if (filterEmptyLines) {
lines = lines.filter(e => e !== "");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you may want to trim() here to remove "blank" lines as well. Not sure if you want to or not.


public constructor(serverContext: TeamServerContext, itemPaths: string[]) {
if (!itemPaths || itemPaths.length === 0) {
throw TfvcError.CreateArgumentMissingError("itemPaths");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use CommandHelper.RequireStringArrayArgument here.

*/
public async ParseOutput(executionResult: IExecutionResult): Promise<string[]> {
//TODO: (Undo All) What if we've been passed 5 files and the 3rd has no pending changes?
if (CommandHelper.HasError(executionResult, "No pending changes were found for ")) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your TODO is valid. You may have errors and "Undoing edit" lines interlaced. You need to skip those errors and just continue.

Copy link
Member

@jpricket jpricket left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You probably want to fix the parsing of the undo to ignore "no pending changes... for" messages.

Copy link
Member

@jpricket jpricket left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants