summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorVincent Driessen <me@nvie.com>2016-06-14 22:44:11 +0200
committerVincent Driessen <me@nvie.com>2016-06-14 23:09:22 +0200
commit3ee291c469fc7ea6065ed22f344ed3f2792aa2ca (patch)
tree2b0b2e213c34fb61a0eb91f358685bb40101b1b0 /doc
parent105a8c0fb3fe61b77956c8ebd3216738c78a3dff (diff)
downloadgitpython-3ee291c469fc7ea6065ed22f344ed3f2792aa2ca.tar.gz
Store raw path bytes in Diff instanceskeep-raw-bytes-on-diffs
Previously, the following fields on Diff instances were assumed to be passed in as unicode strings: - `a_path` - `b_path` - `rename_from` - `rename_to` However, since Git natively records paths as bytes, these may potentially not have a valid unicode representation. This patch changes the Diff instance to instead take the following equivalent fields that should be raw bytes instead: - `a_rawpath` - `b_rawpath` - `raw_rename_from` - `raw_rename_to` NOTE ON BACKWARD COMPATIBILITY: The original `a_path`, `b_path`, etc. fields are still available as properties (rather than slots). These properties now dynamically decode the raw bytes into a unicode string (performing the potentially destructive operation of replacing invalid unicode chars by "�"'s). This means that all code using Diffs should remain backward compatible. The only exception is when people would manually construct Diff instances by calling the constructor directly, in which case they should now pass in bytes rather than unicode strings. See also the discussion on https://github.com/gitpython-developers/GitPython/pull/467
Diffstat (limited to 'doc')
-rw-r--r--doc/source/changes.rst3
1 files changed, 3 insertions, 0 deletions
diff --git a/doc/source/changes.rst b/doc/source/changes.rst
index 3f5b8c50..492d1055 100644
--- a/doc/source/changes.rst
+++ b/doc/source/changes.rst
@@ -5,6 +5,9 @@ Changelog
2.0.6 - Fixes and Features
==========================
+* API: Diffs now have `a_rawpath`, `b_rawpath`, `raw_rename_from`,
+ `raw_rename_to` properties, which are the raw-bytes equivalents of their
+ unicode path counterparts.
* Fix: TypeError about passing keyword argument to string decode() on
Python 2.6.
* Feature: `setUrl API on Remotes <https://github.com/gitpython-developers/GitPython/pull/446#issuecomment-224670539>`_