Page MenuHomePhabricator

How to strip some mercurial commits
Closed, ResolvedPublic

Asked by fedegiova on Mar 25 2016, 2:15 PM.
Referenced Files
None
Subscribers
None
Tokens
"Like" token, awarded by fedegiova.

Details

What's the best way to remove some commits from the server which have been pushed by error?

I can login to the server and issue hg strip in the repo folder but this leaves dangling objects in the DB;

I've found that the commands:

./bin/repository discover 
./bin/repository refs
./bin/repository parents

are able to restore the diffusion view to a working state after the strip.

Is there any way to cleanup the database? Is this work flow discouraged or unsupported? Are there any alternatives?

Answers

cspeckmim
Updated 2,950 Days Ago

I've had to do this once. A branch was merged which should not have been merged. The steps I took were:

  1. Stop all Phabricator services
  2. Strip the merge & branch
    • hg strip -r [bad-merge-commit]
    • hg strip -B [bookmarked-bad-branch]
  3. Start Phabricator services
  4. Repair the repository
    • ./bin/repository update [repo]
  5. I may have also run reparse
    • ./bin/repository reparse [repo]

New Answer

Answer

This question has been marked as closed, but you can still leave a new answer.