I don't think it's the config() handling that is at question here Pat. It's the rm outside of it.
OLD="`dirname $NEW`/`basename $NEW .new`"
# If there's no config file by that name, mv it over:
if [ ! -r $OLD ]; then
mv $NEW $OLD
elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then # toss the redundant copy
# Otherwise, we leave the .new copy for the admin to consider...
rm -f etc/mercurial/hgrc.d/hgk.rc.new
- If old doesn't exist move new to old
- else if new and old are the same remove new
- else leave it for the admin to sort out
- but then it gets deleted anyway outside of config(), so the admin will never get to see it.