How to automatically remove all .orig files in Mercurial working tree?

后端 未结 12 684
刺人心
刺人心 2020-12-13 08:34

During merges mercurial leaves .orig file for any unresolved file. But after manually resolving problems and marking a file correct it does not delete the .orig file. Can it

12条回答
  •  南笙
    南笙 (楼主)
    2020-12-13 09:13

    I'm working in Powershell and didn't see the answer here:

    # NOTE: be in the root of your repository
    # fetch all .orig files recursively
    $orig = (dir *.orig -recurse) ;
    
    # remove each .orig file
    foreach ($item in $orig) { del $($item.FullName) ; }
    
    # afterwards I make sure to remove the references to the .orig files in the repo
    # then commit & push
    hg addremove ; 
    hg commit -m "remove .orig" ;
    hg push ;
    

提交回复
热议问题