How to abandon a hg merge?

前端 未结 4 1116
别那么骄傲
别那么骄傲 2020-12-22 21:06

I\'m new to collaborating with Mercurial. My situation:

  • Another programmer changed rev 1 of a file to replace 4-space indents with 2-space indent. (I.e. change
4条回答
  •  情书的邮戳
    2020-12-22 21:35

    You can discard uncommitted changes with the -C (or --clean) flag:

    hg update -C -r 3
    

    BEWARE: Everything that was not committed will be gone!

    After that you should probably use some kind of code formatter tool to do the entire operation, or at least some find and replace with regular expressions. Something as simple as replacing what matches ^____ (use 4 spaces instead of underscores) with __ (2 spaces), repeated a few times (unless you have insanely some nested code) should work.

提交回复
热议问题