/[scripts]/trunk/svn-undo-last-commit.sh
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /trunk/svn-undo-last-commit.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 102 - (show annotations)
Mon Dec 8 19:10:38 2008 UTC (15 years, 3 months ago) by dpavlin
File MIME type: application/x-sh
File size: 390 byte(s)
undo last commit by dump-load svnadmin cycle for
that "Uups!" moments

1 #!/bin/sh
2
3 if [ -z "$1" ] ; then
4 echo "usage: $0 repo_path"
5 exit
6 fi
7
8 repo=$1
9
10 if [ ! -e "$repo/hooks" ] ; then
11 echo "$repo not repository!";
12 exit
13 fi
14
15 svnadmin create $repo-1 || exit
16 y=`svnlook youngest $repo` || exit
17 prev=`expr $y - 1`
18 echo "# undo $repo up to $prev < $y"
19 svnadmin dump $repo -r 0:$prev | svnadmin load $repo-1 && mv $repo $repo.orig && mv $repo-1 $repo
20 du -kcs $repo*

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26