Skip to content

Instantly share code, notes, and snippets.

@olemb
Created October 20, 2011 15:37
Show Gist options
  • Save olemb/1301449 to your computer and use it in GitHub Desktop.
Save olemb/1301449 to your computer and use it in GitHub Desktop.
Remove dotencode from a Mercurial repository
#!/bin/sh
# Remove dotencode from a Mercurial repository.
if [ -z $1 ]; then
echo "usage: dotdecode REPOSITORY"
echo
echo "A backup will be made to REPOSITORY.dotencode"
exit 1
fi
if [ -z $(grep dotencode $1/.hg/requires) ]; then
echo "No need to convert. (Repository doesn't require dotencode.)"
exit 0
fi
echo Backing up to $1.dotencode
mv $1 $1.dotencode
hg --config format.dotencode=0 clone --pull $1.dotencode $1
# Fix push/pull paths
cp $1.dotencode/.hg/hgrc $1/.hg/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment