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
mercurial-devel
Commits
c7690fabce5f
Commit
c7690fab
authored
Oct 12, 2021
by
Martin von Zweigbergk
Browse files
chistedit: move patchcontents() onto state class
Differential Revision:
https://phab.mercurial-scm.org/D11642
parent
3fdeb657602f
Changes
1
Show whitespace changes
Inline
Side-by-side
hgext/histedit.py
View file @
c7690fab
...
...
@@ -1218,7 +1218,7 @@
curmode
,
_
=
state
.
mode
state
.
mode
=
(
mode
,
curmode
)
if
mode
==
MODE_PATCH
:
state
.
modes
[
MODE_PATCH
][
b
'patchcontents'
]
=
patchcontents
(
state
)
state
.
modes
[
MODE_PATCH
][
b
'patchcontents'
]
=
state
.
patch
_
contents
()
def
makeselection
(
state
,
pos
):
...
...
@@ -1325,19 +1325,6 @@
return
line
[:
n
-
2
]
+
b
' >'
def
patchcontents
(
state
):
repo
=
state
.
repo
rule
=
state
.
rules
[
state
.
pos
]
displayer
=
logcmdutil
.
changesetdisplayer
(
repo
.
ui
,
repo
,
{
b
"patch"
:
True
,
b
"template"
:
b
"status"
},
buffered
=
True
)
overrides
=
{(
b
'ui'
,
b
'verbose'
):
True
}
with
repo
.
ui
.
configoverride
(
overrides
,
source
=
b
'histedit'
):
displayer
.
show
(
rule
.
ctx
)
displayer
.
close
()
return
displayer
.
hunk
[
rule
.
ctx
.
rev
()].
splitlines
()
class
_chistedit_state
(
object
):
def
__init__
(
self
,
...
...
@@ -1590,6 +1577,21 @@
elif
action
==
b
'line-up'
:
return
E_LINEUP
def
patch_contents
(
self
):
repo
=
self
.
repo
rule
=
self
.
rules
[
self
.
pos
]
displayer
=
logcmdutil
.
changesetdisplayer
(
repo
.
ui
,
repo
,
{
b
"patch"
:
True
,
b
"template"
:
b
"status"
},
buffered
=
True
,
)
overrides
=
{(
b
'ui'
,
b
'verbose'
):
True
}
with
repo
.
ui
.
configoverride
(
overrides
,
source
=
b
'histedit'
):
displayer
.
show
(
rule
.
ctx
)
displayer
.
close
()
return
displayer
.
hunk
[
rule
.
ctx
.
rev
()].
splitlines
()
def
_chisteditmain
(
repo
,
rules
,
stdscr
):
try
:
...
...
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