Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
mercurial
TortoiseHg
thg-hgtk
Commits
8b39f078b979
Commit
cbe78144
authored
Dec 29, 2010
by
Steve Borho
Browse files
fileview: return diff as local text lines
Allow caller to strip lines and/or convert to unicode if/when they need
parent
9cc5ea6e39e6
Changes
2
Hide whitespace changes
Inline
Side-by-side
tortoisehg/hgqt/chunks.py
View file @
8b39f078
...
...
@@ -166,7 +166,8 @@ class DiffBrowser(QFrame):
self
.
sci
.
setLexer
(
lexer
)
# TODO: do patch chunking here using record.parsepatch()
# TODO: use indicators to represent current and selection state
self
.
sci
.
setText
(
fd
.
diff
)
utext
=
[
hglib
.
tounicode
(
l
)
for
l
in
fd
.
diff
[
2
:]]
self
.
sci
.
setText
(
u
'
\n
'
.
join
(
utext
))
def
run
(
ui
,
*
pats
,
**
opts
):
'for testing purposes only'
...
...
tortoisehg/hgqt/fileview.py
View file @
8b39f078
...
...
@@ -326,7 +326,8 @@ class HgFileView(QFrame):
if
self
.
_mode
==
'diff'
and
fd
.
diff
:
lexer
=
get_diff_lexer
(
self
)
self
.
sci
.
setLexer
(
lexer
)
self
.
sci
.
setText
(
fd
.
diff
)
utext
=
[
hglib
.
tounicode
(
l
)
for
l
in
fd
.
diff
[
2
:]]
self
.
sci
.
setText
(
u
'
\n
'
.
join
(
utext
))
elif
fd
.
contents
is
None
:
return
else
:
...
...
@@ -584,7 +585,7 @@ class FileData(object):
if
type
(
ctx
.
rev
())
==
str
:
# unapplied patch
chunks
=
ctx
.
thgmqpatchchunks
(
wfile
)
self
.
diff
=
'
\n
'
.
join
(
chunks
)
self
.
diff
=
'
\n
'
.
join
(
chunks
)
.
splitlines
()
return
if
status
is
None
:
...
...
@@ -705,5 +706,4 @@ class FileData(object):
else
:
for
chunkline
in
gen
:
data
.
append
(
chunkline
)
data
=
[
hglib
.
tounicode
(
l
)
for
l
in
data
]
self
.
diff
=
u
'
\n
'
.
join
(
data
[
2
:])
self
.
diff
=
data
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment