diff options
Diffstat (limited to 'libbe/rcs.py')
-rw-r--r-- | libbe/rcs.py | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/libbe/rcs.py b/libbe/rcs.py index dd0c008..6dba51a 100644 --- a/libbe/rcs.py +++ b/libbe/rcs.py @@ -1,18 +1,16 @@ -from arch import * -def mkdir(path): - os.mkdir(path) - add_id(path) +def rcs_by_name(rcs_name): + """Return the module for the RCS with the given name""" + if rcs_name == "Arch": + import arch + return arch + elif rcs_name == "None": + import no_rcs + return no_rcs -def set_file_contents(path, contents): - add = not os.path.exists(path) - file(path, "wb").write(contents) - if add: - add_id(path) - -def unlink(path): - try: - os.unlink(path) - delete_id(path) - except OSError, e: - if e.errno != 2: - raise +def detect(dir): + """Return the module for the rcs being used in this directory""" + import arch + if arch.detect(dir): + return arch + import no_rcs + return no_rcs |