diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-10-07 13:38:19 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-10-07 13:38:19 -0700 |
commit | 98f9556a442647db60dad9c7a754832c16af9e73 (patch) | |
tree | b427b3625d48b1ffa3cd1bedb7d399c9db5043eb /git-p4.py | |
parent | a23d263b69d353e6945281cd1a19fa6f1d0aaeee (diff) | |
parent | 4cb870d8042bef3fdd953c633463eda24ce78f3d (diff) | |
download | git-98f9556a442647db60dad9c7a754832c16af9e73.tar.gz |
Merge branch 'ls/p4-path-encoding'
"git p4" learned to reencode the pathname it uses to communicate
with the p4 depot with a new option.
* ls/p4-path-encoding:
git-p4: use replacement character for non UTF-8 characters in paths
git-p4: improve path encoding verbose output
git-p4: add config git-p4.pathEncoding
Diffstat (limited to 'git-p4.py')
-rwxr-xr-x | git-p4.py | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -2220,6 +2220,16 @@ class P4Sync(Command, P4UserMap): text = regexp.sub(r'$\1$', text) contents = [ text ] + try: + relPath.decode('ascii') + except: + encoding = 'utf8' + if gitConfig('git-p4.pathEncoding'): + encoding = gitConfig('git-p4.pathEncoding') + relPath = relPath.decode(encoding, 'replace').encode('utf8', 'replace') + if self.verbose: + print 'Path with non-ASCII characters detected. Used %s to encode: %s ' % (encoding, relPath) + self.gitStream.write("M %s inline %s\n" % (git_mode, relPath)) # total length... |