summaryrefslogtreecommitdiff
path: root/rdiff-backup/rdiff_backup/FilenameMapping.py
diff options
context:
space:
mode:
authorbescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2003-06-30 03:00:18 +0000
committerbescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2003-06-30 03:00:18 +0000
commit5e09353fe5ce80b724a30db11cb10523d147c6ec (patch)
tree083998f6893121da5d651ee7a475fde3372c78f9 /rdiff-backup/rdiff_backup/FilenameMapping.py
parent46afa3e6b3aacfe05d1586a583a2606cc139f658 (diff)
downloadrdiff-backup-5e09353fe5ce80b724a30db11cb10523d147c6ec.tar.gz
Many changes - added extended attribute support and file system
ability detection git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@334 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
Diffstat (limited to 'rdiff-backup/rdiff_backup/FilenameMapping.py')
-rw-r--r--rdiff-backup/rdiff_backup/FilenameMapping.py20
1 files changed, 15 insertions, 5 deletions
diff --git a/rdiff-backup/rdiff_backup/FilenameMapping.py b/rdiff-backup/rdiff_backup/FilenameMapping.py
index 117d711..066b86a 100644
--- a/rdiff-backup/rdiff_backup/FilenameMapping.py
+++ b/rdiff-backup/rdiff_backup/FilenameMapping.py
@@ -1,4 +1,4 @@
-# Copyright 2002 Ben Escoto
+# Copyright 2002, 2003 Ben Escoto
#
# This file is part of rdiff-backup.
#
@@ -29,7 +29,7 @@ handle that error.)
"""
-import re
+import re, types
import Globals, log, rpath
max_filename_length = 255
@@ -66,12 +66,14 @@ def set_init_quote_vals_local():
def init_quoting_regexps():
"""Compile quoting regular expressions"""
global chars_to_quote_regexp, unquoting_regexp
+ assert chars_to_quote and type(chars_to_quote) is types.StringType, \
+ "Chars to quote: '%s'" % (chars_to_quote,)
try:
chars_to_quote_regexp = \
re.compile("[%s]|%s" % (chars_to_quote, quoting_char), re.S)
unquoting_regexp = re.compile("%s[0-9]{3}" % quoting_char, re.S)
except re.error:
- log.Log.FatalError("Error '%s' when processing char quote list %s" %
+ log.Log.FatalError("Error '%s' when processing char quote list '%s'" %
(re.error, chars_to_quote))
def quote(path):
@@ -131,8 +133,16 @@ class QuotedRPath(rpath.RPath):
def isincfile(self):
"""Return true if path indicates increment, sets various variables"""
- result = rpath.RPath.isincfile(self)
- if result: self.inc_basestr = unquote(self.inc_basestr)
+ if not self.index: # consider the last component as quoted
+ dirname, basename = self.dirsplit()
+ temp_rp = rpath.RPath(self.conn, dirname, (unquote(basename),))
+ result = temp_rp.isincfile()
+ if result:
+ self.inc_basestr = unquote(temp_rp.inc_basestr)
+ self.inc_timestr = unquote(temp_rp.inc_timestr)
+ else:
+ result = rpath.RPath.isincfile(self)
+ if result: self.inc_basestr = unquote(self.inc_basestr)
return result
def get_quotedrpath(rp, separate_basename = 0):