#11180 closed defect (fixed)
Show incorrect properties if the file has unicode path in git repository — at Version 2
Reported by: | Jun Omae | Owned by: | Jun Omae |
---|---|---|---|
Priority: | normal | Milestone: | 1.0.2 |
Component: | plugin/git | Version: | 1.0-stable |
Severity: | normal | Keywords: | unicode |
Cc: | Branch: | ||
Release Notes: |
Fix incorrect property values for file with unicode path in git repository |
||
API Changes: | |||
Internal Changes: |
Description
If a file has unicode path in a git repository, Trac shows the incorrect properties for the file.
attachment:unicode-path-in-git-repos.png
Also, in that case, Python raises the following warning.
/home/jun66j5/src/trac/edgewall/tracopt/versioncontrol/git/PyGIT.py:884: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal if next_path == [path]:
Patch:
-
tracopt/versioncontrol/git/PyGIT.py
diff --git a/tracopt/versioncontrol/git/PyGIT.py b/tracopt/versioncontrol/git/PyGIT.py index 5b2354e..b33991a 100644
a b class Storage(object): 866 866 p = [] 867 867 change = {} 868 868 next_path = [] 869 base_path = self._fs_from_unicode(base_path) 869 870 870 871 def name_status_gen(): 871 872 p[:] = [self.repo.log_pipe('--pretty=format:%n%H', … … class Storage(object): 896 897 gen = name_status_gen() 897 898 898 899 def historian(path): 900 path = self._fs_from_unicode(path) 899 901 try: 900 902 return change[path] 901 903 except KeyError:
Change History (3)
by , 11 years ago
Attachment: | unicode-path-in-git-repos.png added |
---|
comment:1 by , 11 years ago
Owner: | set to |
---|---|
Status: | new → assigned |
comment:2 by , 11 years ago
Keywords: | unicode added |
---|---|
Release Notes: | modified (diff) |
Resolution: | → fixed |
Status: | assigned → closed |
Committed in [11799].
Note:
See TracTickets
for help on using tickets.
Added the patch and unit tests in log:jomae.git:ticket11180/1.0.2dev. I'll push it.