如果我这样做
hg revert subrepo/foo
然后失败,因为我需要为subrepo指定-R。我宁愿不必这样做,所以我写了一个脚本来做。工作正常,但我希望/想知道是否有更好的方法?
#!/bin/bash
for file in $*; do
repo=$(echo $file | cut -d'/' -f-1)
file=$(echo $file | cut -d'/' -f2-)
if [ -f $repo/$file ]; then
hg revert -R $repo $repo/$file
fi
done