REPO_URL=$1

rm -rf test_repo
darcs-build get $REPO_URL --repodir test_repo
cd test_repo

FILES=$(darcs-build show files --no-directories)

run_commands () {
   for f in $FILES
   do

      darcs-build $COMMAND $f > o1

      mv _darcs/patch_index _darcs/.patch_index
      touch _darcs/no_patch_index

      darcs-build $COMMAND $f > o2

      mv _darcs/.patch_index _darcs/patch_index
      rm _darcs/no_patch_index

      diff -q o1 o2
   done
}

COMMAND=changes
run_commands

COMMAND=annotate
run_commands
