Change the way methods that take a path argument behave.
authorGary van der Merwé <garyvdm@gmail.com>
Wed, 22 Apr 2015 14:13:25 +0000 (16:13 +0200)
committerGary van der Merwé <garyvdm@gmail.com>
Thu, 23 Apr 2015 07:19:04 +0000 (09:19 +0200)
commit7a02943889d2744f6329103e71089ad037eaf109
tree53f5516df72d3a51872ce1680a438dd67819497f
parentfd2f4f425a02d3fa47babac845ef44fb654f1e9f
Change the way methods that take a path argument behave.

For a number of user facing methods, make it possible to pass in paths in as
either a unicode string, or bytes. These include:

* Repo.__init__
* Repo.init
* Repo.init_bare
* index.build_index_from_tree
* index.get_unstaged_changes

The repo.Repo.path attribute will remain unchanged. The Repo._controldir
attribute and a new Repo._path_bytes attribute are ensured to be bytes.

For a number of internal methods, it now requires a bytes path rather than
a unicode string. These include:

* objects.hex_to_filename
* objects.filename_to_hex
* _GitFile.__init__
* ShellHook.__init__ (and subclassed of ShellHook)
* DiskObjectStore.__init__
* DiskRefsContainer.__init__
* Repo._put_named_file
* Repo.get_named_file
* pack.write_pack
* Pack.__init__
* etc...
22 files changed:
dulwich/file.py
dulwich/hooks.py
dulwich/index.py
dulwich/object_store.py
dulwich/objects.py
dulwich/pack.py
dulwich/porcelain.py
dulwich/refs.py
dulwich/repo.py
dulwich/server.py
dulwich/tests/compat/server_utils.py
dulwich/tests/compat/test_pack.py
dulwich/tests/test_file.py
dulwich/tests/test_grafts.py
dulwich/tests/test_hooks.py
dulwich/tests/test_object_store.py
dulwich/tests/test_objects.py
dulwich/tests/test_pack.py
dulwich/tests/test_porcelain.py
dulwich/tests/test_refs.py
dulwich/tests/test_repository.py
dulwich/tests/utils.py