view util.py @ 27:b66ed66c82e4

Fix this so the tests can still be run without nose.
author Augie Fackler <durin42@gmail.com>
date Fri, 10 Oct 2008 14:18:24 -0500
parents 1267b1944cd7
children 50d55c3e0d85
line wrap: on
line source

import os
import shutil

svn_subcommands = { }

def register_subcommand(name):
    def inner(fn):
        svn_subcommands[name] = fn
        return fn
    return inner


def wipe_all_files(hg_wc_path):
    files = [f for f in os.listdir(hg_wc_path) if f != '.hg']
    for f in files:
        f = os.path.join(hg_wc_path, f)
        if os.path.isdir(f):
            shutil.rmtree(f)
        else:
            os.remove(f)