xmlto html-nochunks rcs-fast-import.xml
clean:
- rm -f *~ *.1 *.html *.tar.gz MANIFEST SHIPPER.*
+ rm -f *~ *.1 *.html *.tar.gz MANIFEST
rm -fr .rs* typescript test/typescript
rcs-fast-import-$(VERS).tar.gz: $(SOURCES) rcs-fast-import.1
(cd ..; tar -czvf rcs-fast-import/rcs-fast-import-$(VERS).tar.gz `cat rcs-fast-import/MANIFEST`)
@(cd ..; rm rcs-fast-import-$(VERS))
-PYLINTOPTS = --rcfile=/dev/null --reports=n --include-ids=y --disable="C0103,C0111,C0301,C0323,R0902,R0903,R0912,R0913,R0914,R0915,W0141,W0333,W0142,W0621,E1101"
+PYLINTOPTS = --rcfile=/dev/null --reports=n \
+ --msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" \
+ --dummy-variables-rgx='^_'
+SUPPRESSIONS = "C0103,C0111,C0301,C0323,C1001,R0902,R0903,R0912,R0913,R0914,R0915,W0110,W0141,W0333,W0142,W0621,E1101"
pylint:
- @pylint --output-format=parseable $(PYLINTOPTS) rcs-fast-import
+ @pylint $(PYLINTOPTS) --disable=$(SUPPRESSIONS) rcs-fast-import
version:
@echo $(VERS)
dist: rcs-fast-import-$(VERS).tar.gz
release: rcs-fast-import-$(VERS).tar.gz rcs-fast-import.html
- shipper -u -m -t; make clean
+ shipper -u -t version=$(VERS); make clean
# Requires Python 2.5 or newer and RCS 5.7 or newer.
#
"""
-Usage: rcs-fast-import [-v] [-p] [-u] [-l] [-V] [-?]
+Usage: rcs-fast-import [-v] [-p] [-u] [-l] [-V] [-?]
Break the content of a git-fast-import stream on stdin into individual RCS
master files in RCS subdirectories of the corresponding directory structure.
def __init__(self, text):
"Recognize date formats that exporters or email programs might emit."
# First, look for git's preferred format.
- text = text.strip()
+ text = text.strip()
if re.match(r"[0-9]+\s*[+-][0-9]+$", text):
(self.timestamp, self.timezone) = text.split()
self.timestamp = int(self.timestamp)
self.childbranches = [] # Count of child branches at this point.
def children(self):
"Get a list of this commit's children."
- return filter(lambda e:self.mark in e.parent_marks, self.repo.commits())
+ return filter(lambda e:self.mark in e.parent_marks, self.repo.commits())
def parents(self):
"Get a list of this commit's parents."
- return filter(lambda e:e.mark in self.parent_marks, self.repo.commits())
+ return filter(lambda e:e.mark in self.parent_marks, self.repo.commits())
def is_tip(self):
"Is this commit a branch tip?"
# Added for rcs-fast-import
self.import_line = 0
self.basedir = os.getcwd()
# __enter and __exit__ added for rcs-fast-import
- def __enter__(self):
+ def __enter__(self):
return self
def __exit__(self, type_unused, value_unused, traceback_unused):
self.cleanup()
if not name:
return os.path.join(self.basedir, ".rs" + `os.getpid()`)
else:
- return os.path.join(self.basedir, ".rs" + `os.getpid()`+ "-" + name)
+ return os.path.join(self.basedir, ".rs" + `os.getpid()`+ "-" + name)
def error(self, msg, atline=True):
if atline:
raise FatalException(msg + " at line " + `self.import_line`)
raise FatalException("can't create RCS directory.")
self.branch_tips = {}
def get_tip(self, path, branch):
- "Get the tip ID for a patch/branch combination that already exists."
+ "Get the tip ID for a patch/branch combination that already exists."
return self.branch_tips[(path, branch)]
def make_tip(self, commit, path):
"Make a new tip ID for a given path and branch."
checkout_mode = None
roundtrip = True
for (switch, val) in options:
- if (switch == '-?'):
+ if switch == '-?':
print __doc__
- raise SystemExit, 0
+ raise SystemExit(0)
elif switch == '-p':
roundtrip = False
elif switch in ('-l', '-u'):
checkout_mode = switch
- elif (switch == '-v'):
+ elif switch == '-v':
verbose += 1
- elif (switch == '-V'):
+ elif switch == '-V':
print "rcs-fast-import version %s" % version
- raise SystemExit, 0
+ raise SystemExit(0)
vcs = RCS()
- vcs.roundtrip = roundtrip
+ vcs.roundtrip = roundtrip
try:
with Repository() as repo:
here = os.getcwd()
finally:
nuke(tempdir, "cleaning up")
vcs.postactions(checkout_mode)
- raise SystemExit, 0
+ raise SystemExit(0)
except FatalException, e:
complain(e.msg)
- raise SystemExit, 1
+ raise SystemExit(1)
except OSError, e:
complain(e)
- raise SystemExit, 1
+ raise SystemExit(1)
# end