Skip to content

Instantly share code, notes, and snippets.

@kamawanu
Created August 7, 2010 07:31
Show Gist options
  • Save kamawanu/512557 to your computer and use it in GitHub Desktop.
Save kamawanu/512557 to your computer and use it in GitHub Desktop.
svn & mercurial scripts
#!/bin/sh -x
#svnadmin create file:$PWD/$( basename $1 )
URL1=$( echo $1 | sed -e 's/\/trunk\///' )
NAMING=$( echo $URL1 | sed -e 's/\/\/*/\//g;s/\/$//' | rev | cut -d/ -f1-2 | rev | tr / _ )
echo $URL1
echo $NAMING
###exit
NAMING=SVFS-$NAMING
svnadmin create $NAMING
( echo "#!/bin/sh" ; echo exit 0 ) > $NAMING/hooks/pre-revprop-change
chmod +x $NAMING/hooks/pre-revprop-change
svnsync init file://$PWD/$NAMING/ $URL1
svnsync sync file://$PWD/$NAMING
hg convert $NAMING
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment