Revert Mercurial Commit for Merge

126 Views Asked by At

I am working on a Hg repo in BitBucket. I forked this repo from another main repo.

Here's my scenario:

> hg paths

default = ssh://[email protected]/shuwnyuantee/jstock-android-as
yccheok = ssh://[email protected]/yccheok/jstock-android-as

default repo is my forked repo. yccheok is the main repo I forked from.

I did the below so I am on drive-wealth branch of default repo.

> hg pull
pulling from ssh://[email protected]/shuwnyuantee/jstock-android-as

> hg update drive-wealth
128 files updated, 0 files merged, 1 files removed, 0 files unresolved

> hg branch
drive-wealth


> hg log -l 3
changeset:   2770:a210525cc123
branch:      drive-wealth
tag:         tip
parent:      2769:a0bacd6f326a
parent:      2768:0eb8c0268784
user:        Shuwn Yuan Tee <[email protected]>
date:        Tue Mar 21 16:41:04 2017 +0800
summary:     merge default branch

changeset:   2769:a0bacd6f326a
branch:      drive-wealth
parent:      2676:7571be00648f
user:        Shuwn Yuan Tee <[email protected]>
date:        Tue Mar 21 13:17:14 2017 +0800
summary:     list all accounts API

changeset:   2768:0eb8c0268784
user:        Yan Cheng Cheok <[email protected]>
date:        Sat Mar 18 13:56:51 2017 +0800
summary:     Add the missing tracker name.

I wish to revert commit 2770:a210525cc123 on drive-wealth branch & push to default repo. I tried hg strip --keep -r . suggested here. Some files appear as Modified as:

> hg status
M achartengine/build.gradle
M androidXml/build.gradle
M androidlockpattern/build.gradle
M gradle/wrapper/gradle-wrapper.properties
M jstockandroid/build.gradle
M jstockandroid/src/main/AndroidManifest.xml
......

My questions are:

1) Those files show changes in Merge, but not all files are reverted correctly, many changes are missing / not undone. Any idea?

2) If (1) successfully undo all, then what are steps to proceed? What I want to achieve is => simply revert commit 2770:a210525cc123 on branch drive-wealth for default repo & push to default repo?

Thanks!

1

There are 1 best solutions below

1
On

don't you need to also trip 2769? as 2770 is your merge commit

so

hg strip --keep -r 2770
hg strip --keep -r 2769

then push