Simplify resolving Mercurial conflicts
If you frequently find yourself resolving conflicts in Mercurial, stick this in your startup script of choice, it can speed things up a bit:
conflictedFiles="find . -name '*.orig' | sed 's/\.orig//g'"
# open conflicted files in text editor of choice - e.g. SublimeText
alias o="$conflictedFiles | xargs subl"
# do work, then:
# mark conflicted files as resolved
alias r="$conflictedFiles | xargs -I {} hg resolve -m {}"
# delete original files
alias d="find . -name '*.orig' | xargs rm"
Usage: type "o", do work to resolve conflicts, type "r", then "d" (open, resolve, delete).
Written by Jude Robinson
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Shell
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#