Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented Hg.createBranch() and removed Hg.checkout() after hg.createBranch() call. #36

Merged
merged 2 commits into from
Nov 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/hg/src/browser/hg-quick-open-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,6 @@ export class HgQuickOpenService {
async () => {
try {
await hgQuickOpenService.hg.createBranch(repository, lookFor);
await hgQuickOpenService.hg.checkout(repository, { branch: lookFor });
} catch (error) {
hgQuickOpenService.hgErrorHandler.handleError(error);
}
Expand Down
4 changes: 1 addition & 3 deletions packages/hg/src/common/hg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -631,10 +631,8 @@ export interface Hg extends Disposable {
*
* @param the repository where the branch modification has to be performed.
* @param branchName The desired name of the new branch.
* @param branchStartPoint The new branch head will point to this commit. It may be given as a branch name, a commit-id, or a tag.
* If this parameter is omitted, the current `HEAD` will be used instead.
*/
createBranch(repository: Repository, branchName: string, branchStartPoint?: string): Promise<void>
createBranch(repository: Repository, branchName: string): Promise<void>

Choose a reason for hiding this comment

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

Thanks for removing the parameter. It makes no sense in Mercurial.


/**
* Switches branches or restores working tree files.
Expand Down
4 changes: 2 additions & 2 deletions packages/hg/src/node/hg-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,8 @@ export class HgImpl implements Hg {

}

async createBranch(repository: Repository, branchName: string, branchStartPoint?: string): Promise<void> {
throw Error('not implemented yet');
async createBranch(repository: Repository, branchName: string): Promise<void> {
await this.runCommand(repository, ['branch', branchName]);
}

async checkout(repository: Repository, options: Hg.Options.Checkout.CheckoutBranch | Hg.Options.Checkout.WorkingTreeFile): Promise<void> {
Expand Down