Mercurial > hgsubversion
diff svncommand.py @ 208:de3807ceea5c
Removed verify_* commands and replaced them with a shell script to pass to hg bisect --command.
author | Augie Fackler <durin42@gmail.com> |
---|---|
date | Mon, 09 Mar 2009 14:13:48 -0500 |
parents | 77812f98e250 |
children | 2165461d2dd8 1611834e39ee |
line wrap: on
line diff
--- a/svncommand.py +++ b/svncommand.py @@ -102,69 +102,3 @@ def update(ui, args, repo, clean=False, answers]+[''])) return 1 update = register_subcommand('up')(update) - - -def verify_revision(ui, args, repo, force=False, **opts): - """verify a single converted revision - Note: This wipes your working copy and then exports the corresponding - Subversion into your working copy to verify. Use with caution. - """ - assert len(args) == 1 - if not force: - assert repo.status(ignored=True, - unknown=True) == ([], [], [], [], [], [], []) - rev = int(args[0]) - wc_path = os.path.dirname(repo.path) - svn_url = open(os.path.join(repo.path, 'svn', 'url')).read() - svn = svnwrap.SubversionRepo(svn_url, username=merc_util.getuser()) - util.wipe_all_files(wc_path) - if update(ui, args, repo, clean=True) == 0: - util.wipe_all_files(wc_path) - br = repo.dirstate.branch() - if br == 'default': - br = None - if br: - diff_path = 'branches/%s' % br - else: - diff_path = 'trunk' - svn.fetch_all_files_to_dir(diff_path, rev, wc_path) - stat = repo.status(unknown=True) - ignored = [s for s in stat[4] - if '/.svn/' not in s and not s.startswith('.svn/')] - stat = stat[0:4] - if stat != ([], [], [], [],) or ignored != []: - ui.status('Something is wrong with this revision.\n') - return 2 - else: - ui.status('OK.\n') - return 0 - return 1 -verify_revision = register_subcommand('verify_revision')(verify_revision) - -def verify_all_revisions(ui, args, repo, **opts): - """verify converted revisions; all or starting at a revision - - Note: This is *extremely* abusive of the Subversion server. It exports every - revision of the code one revision at a time. - """ - assert repo.status(ignored=True, - unknown=True) == ([], [], [], [], [], [], []) - start_rev = 0 - args = list(args) - if args: - start_rev = int(args.pop(0)) - revmap = util.parse_revmap(os.path.join(repo.path, 'svn', 'rev_map')) - revs = sorted(revmap.keys()) - for revnum, br in revs: - if revnum < start_rev: - continue - res = verify_revision(ui, [revnum], repo, force=True) - if res == 0: - print revnum, 'verfied' - elif res == 1: - print revnum, 'skipped' - else: - print revnum, 'failed' - return 1 - return 0 -verify_all_revisions = register_subcommand('verify_all_revisions')(verify_all_revisions)