diff options
author | Pieter de Bie <pdebie@ai.rug.nl> | 2008-06-20 22:00:34 +0200 |
---|---|---|
committer | Pieter de Bie <pdebie@ai.rug.nl> | 2008-06-20 22:00:34 +0200 |
commit | 9f78857c060702f7efb239b7adf05d1f6602edc0 (patch) | |
tree | 047e790f60102f71ed191b47fb9f2800d21c44fb /exporters | |
parent | cfd803efc58b303f06c27e064034b9bd6a7ee169 (diff) | |
download | bzr-fastimport-9f78857c060702f7efb239b7adf05d1f6602edc0.tar.gz |
bzr-fast-export: don't crash on paths that are invalid regexes
This uses normal string functions to match and replace paths, which
means that the exporter won't crash when trying to detect whether a
path is a recursive rename if it's an illegal regex
Diffstat (limited to 'exporters')
-rwxr-xr-x | exporters/bzr-fast-export.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/exporters/bzr-fast-export.py b/exporters/bzr-fast-export.py index fd3d0f9..3577b86 100755 --- a/exporters/bzr-fast-export.py +++ b/exporters/bzr-fast-export.py @@ -186,8 +186,8 @@ class BzrFastExporter: for old, new in renamed.iteritems(): # If a previous rename is found in this rename, we should # adjust the path - if re.match(old, oldpath): - oldpath = re.sub(old + "/", new + "/", oldpath) + if old in oldpath: + oldpath = oldpath.replace(old + "/", new + "/") self.debug("Fixing recursive rename for %s" % oldpath) renamed[oldpath] = newpath |