This is where the "unmove" script is written in bash. Up there is help text. The most important point is that the script has a parameter that forcibly deletes any file deletion.
#!/bin/bash # Syntax: $0 [OPTION] DEST # # This script is mainly intended to undo the effects of: hg move SOURCE DEST # # It first determines which files have been added globally (as if by # hg add), then it runs: # hg -v revert DEST # Finally, it removes all the files that had been added, # and then reverts them as well if possible. # # OPTIONS: # -i :: remove files using rm -i if [ "$1" = -i ] ; then INTERACT=$1 shift fi TODO=() while read -rf ; do TODO+=("$f") done < <( hg st -an " $@ " ) function go { hg -v revert " $@ " for f in "${TODO[@]}" ; do rm $INTERACT "$f" hg -q files "$f" > /dev/null && hg revert "$f" done } go
source share