Finish issue #420 - "cvsdbadmin rebuild" and "svndbadmin rebuild"

complain about unknown repositories.

* bin/svndbadmin
  (main): When rebuilding, ignore the UnknownRepositoryError; when
    purging, turn that sucker into something readable.

* bin/cvsdbadmin
  (__main__): When rebuilding, ignore the UnknownRepositoryError; when
    purging, turn that sucker into something readable.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2195 8cb11bc2-c004-0410-86c3-e597b4017df7
orig-r2243
cmpilato 2009-06-08 15:50:51 +00:00
parent 1d496a8f51
commit 8910c295cc
2 changed files with 12 additions and 2 deletions

View File

@ -177,7 +177,12 @@ if __name__ == '__main__':
if command in ('rebuild', 'purge'):
if quiet_level < 2:
print "Purging existing data for repository root `%s'" % root
db.PurgeRepository(root)
try:
db.PurgeRepository(root)
except cvsdb.UnknownRepositoryError, e:
if command == 'purge':
sys.stderr.write("ERROR: " + str(e) + "\n")
sys.exit(1)
if command in ('rebuild', 'update'):
repository = vclib.ccvs.CVSRepository(None, rootpath, None,

View File

@ -245,7 +245,12 @@ def main(command, repository, revs=[], verbose=0, force=0):
if command in ('rebuild', 'purge'):
if verbose:
print "Purging commit info for repository root `%s'" % repository
db.PurgeRepository(repository)
try:
db.PurgeRepository(repository)
except cvsdb.UnknownRepositoryError, e:
if command == 'purge':
sys.stderr.write("ERROR: " + str(e) + "\n")
sys.exit(1)
repo = SvnRepo(repository)
if command == 'rebuild' or (command == 'update' and not revs):