anchor.diff:      cd $name
       lockfile -r $LOCK_RETRIES ${PWD}/syncing.lck || die "Could not lock destionation"
       hg pull $GLOBAL_HG_OPTS $CHANGESET
  -    ssh -i <%= @mirror_priv_key_path %> -l <%= @mirror_user_name %> <%= @mirror_source %> pushlog $name > .hg/pushlog2.db
  +    TEMPFILE=$(/bin/mktemp)
  +    ssh -i <%= @mirror_priv_key_path %> -l <%= @mirror_user_name %> <%= @mirror_source %> pushlog $name > $TEMPFILE
  +    /bin/mv $TEMPFILE .hg/pushlog2.db
       exit_code=$?
       rm ${PWD}/syncing.lck
   elif [ \! -e $name ]; then
       mkdir -p `dirname $name` 
       echo "$name does not yet exist, cloning"
  -    lockfile -r $LOCK_RETRIES ${PWD}/syncing.lck || die "Could not lock destionation"
  +    lockfile -r $LOCK_RETRIES ${PWD}/syncing.lck || die "Could not lock destination"
       hg clone $GLOBAL_HG_OPTS -U -v "$src" $name
  -    ssh -i <%= @mirror_priv_key_path %> -l <%= @mirror_user_name %> <%= @mirror_source %> pushlog $name > ${name}/.hg/pushlog2.db
  +    TEMPFILE=$(/bin/mktemp)
  +    ssh -i <%= @mirror_priv_key_path %> -l <%= @mirror_user_name %> <%= @mirror_source %> pushlog $name > $TEMPFILE
  +    /bin/mv $TEMPFILE .hg/pushlog2.db
       exit_code=$?
       rm ${PWD}/syncing.lck
   else
  
positive.code: 
  GLOBAL_HG_OPTS="--config hooks.pretxnchangegroup.z_linearhistory= --config hooks.pretxnchangegroup.z_loghistory= --config trusted.users=root,hg --config paths.default=ssh://<%= @mirror_source %>/${name}"
  
  cd $REPO_TARGET || die "$REPO_TARGET does not exist, cannot create repositories there"
  
  exit_code=0
  
negative.code:         -c|--changeset)
              CHANGESET="-r $2" ; shift 2
              ;;
          -e|--repo)
              REPO="$2" ; shift 2
              ;;
          -d|--delete)
              DELETE=true ; shift 1
              ;;
          -h|--help)
              usage
              exit 0
  