Lines 345-351
Link Here
|
345 |
@return: The two encodings |
345 |
@return: The two encodings |
346 |
@rtype: C{tuple} of C{str} |
346 |
@rtype: C{tuple} of C{str} |
347 |
""" |
347 |
""" |
348 |
from encodings import exceptions |
|
|
349 |
|
348 |
|
350 |
enc1 = enc2 = default |
349 |
enc1 = enc2 = default |
351 |
if not change.wasAdded() or change.wasCopied(): |
350 |
if not change.wasAdded() or change.wasCopied(): |
Lines 353-359
Link Here
|
353 |
enc1 = self._getContentEncoding( |
352 |
enc1 = self._getContentEncoding( |
354 |
change.getBasePath(), change.getBaseRevision() |
353 |
change.getBasePath(), change.getBaseRevision() |
355 |
) |
354 |
) |
356 |
except exceptions.LookupError: |
355 |
except LookupError: |
357 |
# fall back |
356 |
# fall back |
358 |
pass |
357 |
pass |
359 |
|
358 |
|
Lines 364-370
Link Here
|
364 |
enc2 = self._getContentEncoding( |
363 |
enc2 = self._getContentEncoding( |
365 |
change.path, change.revision |
364 |
change.path, change.revision |
366 |
) |
365 |
) |
367 |
except exceptions.LookupError: |
366 |
except LookupError: |
368 |
# fall back |
367 |
# fall back |
369 |
pass |
368 |
pass |
370 |
|
369 |
|
Lines 389-395
Link Here
|
389 |
@exception encodings.exception.LookupError: The specified encoding |
388 |
@exception encodings.exception.LookupError: The specified encoding |
390 |
is not implemented or no encoding was specified |
389 |
is not implemented or no encoding was specified |
391 |
""" |
390 |
""" |
392 |
from encodings import exceptions |
|
|
393 |
|
391 |
|
394 |
# first try the svn:mime-type |
392 |
# first try the svn:mime-type |
395 |
enc = self.getEncodingFromMimeType(path, revision) |
393 |
enc = self.getEncodingFromMimeType(path, revision) |
Lines 427-433
Link Here
|
427 |
codecs.lookup(enc) |
425 |
codecs.lookup(enc) |
428 |
return enc |
426 |
return enc |
429 |
|
427 |
|
430 |
raise exceptions.LookupError("No Encoding configured") |
428 |
raise LookupError("No Encoding configured") |
431 |
|
429 |
|
432 |
|
430 |
|
433 |
def getEncodingFromMimeType(self, path, revision): |
431 |
def getEncodingFromMimeType(self, path, revision): |