Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.4rc2, 0.4rc3, and 0.4rc4

hggtk/changeset: do not override commit message encoding

Read message as utf, falling back to mercurial.util._fallbackencoding
on error (should happen only on repositories created before
localization support - see mercurial.util)

Changeset 589f51dc2f10

Parent 87c6731d7175

by Wagner Bruna

Changes to 2 files · Browse files at 589f51dc2f10 Showing diff from parent 87c6731d7175 Diff from another changeset...

 
124
125
126
127
 
 
 
 
128
129
130
 
135
136
137
138
 
 
 
 
139
140
141
 
124
125
126
 
127
128
129
130
131
132
133
 
138
139
140
 
141
142
143
144
145
146
147
@@ -124,7 +124,10 @@
  for p in parents:   pctx = self.repo.changectx(p)   summary = pctx.description().splitlines()[0] - summary = unicode(summary, 'latin-1', 'replace') + try: + summary = unicode(summary) + except UnicodeDecodeError: + summary = unicode(summary, util._fallbackencoding, 'replace')   change = str(p) + ':' + short(self.repo.changelog.node(p))   title = 'parent:'   title += ' ' * (12 - len(title)) @@ -135,7 +138,10 @@
  for n in self.repo.changelog.children(ctx.node()):   cctx = self.repo.changectx(n)   summary = cctx.description().splitlines()[0] - summary = unicode(summary, 'latin-1', 'replace') + try: + summary = unicode(summary) + except UnicodeDecodeError: + summary = unicode(summary, util._fallbackencoding, 'replace')   childrev = self.repo.changelog.rev(n)   change = str(childrev) + ':' + short(n)   title = 'child:'
 
85
86
87
88
 
 
 
 
 
89
90
91
 
85
86
87
 
88
89
90
91
92
93
94
95
@@ -85,7 +85,11 @@
  ctx = self.repo.changectx(revid)     summary = ctx.description().replace('\0', '') - summary = unicode(summary.split('\n')[0], 'latin-1', 'replace') + summary = summary.split('\n')[0] + try: + summary = unicode(summary) + except UnicodeDecodeError: + summary = unicode(summary, util._fallbackencoding, 'replace')   summary = gobject.markup_escape_text(summary)   node = self.repo.lookup(revid)   tags = ', '.join(self.repo.nodetags(node))