view move-if-change @ 78196:2e0600da7d6a

(vc-find-root): Walk up the tree to find an existing `file' from which to start the search and fix case where `file' is the current directory and the root as well.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Mon, 23 Jul 2007 05:38:44 +0000
parents 354e0c45cedf
children 14a97ab281d5
line wrap: on
line source

#!/bin/sh
if
test -r $2
then
if
cmp $1 $2 > /dev/null
then
echo $2 is unchanged
rm -f $1
else
mv -f $1 $2
fi
else
mv -f $1 $2
fi