Refactoring step.

This commit is contained in:
Eric S. Raymond 2007-05-11 02:12:54 +00:00
parent a390eb9951
commit 058e97a053
2 changed files with 30 additions and 14 deletions

View file

@ -9,7 +9,7 @@
# and renames, also map format conversions.
#
# Takes any number of directories as arguments. Each directory is converted.
# If no directiories are specified, acts on the current directory.
# If no directories are specified, acts on the current directory.
#
# The recommended procedure is this:
# 1. Run it with --dryrun first to see what it will do.
@ -27,18 +27,7 @@
# get confused.
import sys, os, re, getopt, curses.ascii, string, copy
## Version-control hooks begin here.
#
# Change these if we move away from Subversion
vcdir = ".svn"
def vcmove(src, dst):
"Move a file under version control. Only applied to unmodified files."
return "svn mv %s %s" % (src, dst)
## Version-control hooks end here
from wmltools import *
filemoves = {
# Older includes all previous to 1.3.1.

View file

@ -263,4 +263,31 @@ class CrossRef:
self.missing.append((name, Reference(fn,n+1)))
rfp.close()
# wmltools.py gends here
## Version-control hooks begin here.
#
# Change these if we move away from Subversion
vcdir = ".svn"
def vcmove(src, dst):
"Move a file under version control. Only applied to unmodified files."
(dir, base) = os.path.split(src)
if os.path.exists(os.path.join(dir, ".svn")):
return "svn mv %s %s" % (src, dst)
else:
return "mv %s %s" % (src, dst)
def vcunmove(src, dst):
"Revert the result of a previous move (before commit)."
(dir, base) = os.path.split(src)
if os.path.exists(os.path.join(dir, ".svn")):
return "svn revert %s" % dst # Revert the add at the destination
return "rm %s" dst # Remove the moved copy
return "svn revert %s" % src # Revert the deletion
else:
return "mv %s %s" % (dst, src)
#
## Version-control hooks end here
# wmltools.py ends here