70 args.append("--force") |
70 args.append("--force") |
71 else: |
71 else: |
72 args.append("--rev") |
72 args.append("--rev") |
73 args.append(rev) |
73 args.append(rev) |
74 |
74 |
75 env = { |
|
76 "HGEDITOR": "{0} {1}".format( |
|
77 PythonUtilities.getPythonExecutable(), editor |
|
78 ), |
|
79 "EDITOR": "{0} {1}".format( |
|
80 PythonUtilities.getPythonExecutable(), editor |
|
81 ), |
|
82 } |
|
83 |
|
84 dia = HgDialog( |
75 dia = HgDialog( |
85 self.tr("Starting histedit session"), self.vcs, useClient=False |
76 self.tr("Starting histedit session"), self.vcs, useClient=False |
86 ) |
77 ) |
87 res = dia.startProcess(args, environment=env) |
78 res = dia.startProcess(args) |
88 if res: |
79 if res: |
89 dia.exec() |
80 dia.exec() |
90 res = dia.hasAddOrDelete() |
81 res = dia.hasAddOrDelete() |
91 self.vcs.checkVCSStatus() |
82 self.vcs.checkVCSStatus() |
92 return res |
83 return res |
96 Public method to continue an interrupted histedit session. |
87 Public method to continue an interrupted histedit session. |
97 |
88 |
98 @return flag indicating that the project should be reread |
89 @return flag indicating that the project should be reread |
99 @rtype bool |
90 @rtype bool |
100 """ |
91 """ |
|
92 editor = os.path.join(os.path.dirname(__file__), "HgHisteditEditor.py") |
|
93 |
101 args = self.vcs.initCommand("histedit") |
94 args = self.vcs.initCommand("histedit") |
102 args.append("--continue") |
95 args.append("--continue") |
103 args.append("-v") |
96 args.append("-v") |
104 |
97 args.extend( |
105 editor = os.path.join(os.path.dirname(__file__), "HgHisteditEditor.py") |
98 [ |
106 env = { |
99 "--config", |
107 "HGEDITOR": "{0} {1}".format(PythonUtilities.getPythonExecutable(), editor) |
100 f"ui.editor={PythonUtilities.getPythonExecutable()} {editor}", |
108 } |
101 ] |
|
102 ) |
109 |
103 |
110 dia = HgDialog(self.tr("Continue histedit session"), self.vcs, useClient=False) |
104 dia = HgDialog(self.tr("Continue histedit session"), self.vcs, useClient=False) |
111 res = dia.startProcess(args, environment=env) |
105 res = dia.startProcess(args) |
112 if res: |
106 if res: |
113 dia.exec() |
107 dia.exec() |
114 res = dia.hasAddOrDelete() |
108 res = dia.hasAddOrDelete() |
115 self.vcs.checkVCSStatus() |
109 self.vcs.checkVCSStatus() |
116 return res |
110 return res |
117 |
111 |
118 def hgHisteditAbort(self, name): |
112 def hgHisteditAbort(self): |
119 """ |
113 """ |
120 Public method to abort an interrupted histedit session. |
114 Public method to abort an interrupted histedit session. |
121 |
115 |
122 @param name file/directory name |
|
123 @type str |
|
124 @return flag indicating that the project should be reread |
116 @return flag indicating that the project should be reread |
125 @rtype bool |
117 @rtype bool |
126 """ |
118 """ |
|
119 editor = os.path.join(os.path.dirname(__file__), "HgHisteditEditor.py") |
|
120 |
127 args = self.vcs.initCommand("histedit") |
121 args = self.vcs.initCommand("histedit") |
128 args.append("--abort") |
122 args.append("--abort") |
129 args.append("-v") |
123 args.append("-v") |
130 |
124 args.extend( |
131 editor = os.path.join(os.path.dirname(__file__), "HgHisteditEditor.py") |
125 [ |
132 env = { |
126 "--config", |
133 "HGEDITOR": "{0} {1}".format(PythonUtilities.getPythonExecutable(), editor) |
127 f"ui.editor={PythonUtilities.getPythonExecutable()} {editor}", |
134 } |
128 ] |
|
129 ) |
135 |
130 |
136 dia = HgDialog(self.tr("Abort histedit session"), self.vcs, useClient=False) |
131 dia = HgDialog(self.tr("Abort histedit session"), self.vcs, useClient=False) |
137 res = dia.startProcess(args, environment=env) |
132 res = dia.startProcess(args) |
138 if res: |
133 if res: |
139 dia.exec() |
134 dia.exec() |
140 res = dia.hasAddOrDelete() |
135 res = dia.hasAddOrDelete() |
141 self.vcs.checkVCSStatus() |
136 self.vcs.checkVCSStatus() |
142 return res |
137 return res |
147 histedit session. |
142 histedit session. |
148 |
143 |
149 @return flag indicating that the project should be reread |
144 @return flag indicating that the project should be reread |
150 @rtype bool |
145 @rtype bool |
151 """ |
146 """ |
|
147 editor = os.path.join(os.path.dirname(__file__), "HgHisteditEditor.py") |
|
148 |
152 args = self.vcs.initCommand("histedit") |
149 args = self.vcs.initCommand("histedit") |
153 args.append("--edit-plan") |
150 args.append("--edit-plan") |
154 args.append("-v") |
151 args.append("-v") |
155 |
152 args.extend( |
156 editor = os.path.join(os.path.dirname(__file__), "HgHisteditEditor.py") |
153 [ |
157 env = { |
154 "--config", |
158 "HGEDITOR": "{0} {1}".format(PythonUtilities.getPythonExecutable(), editor) |
155 f"ui.editor={PythonUtilities.getPythonExecutable()} {editor}", |
159 } |
156 ] |
|
157 ) |
160 |
158 |
161 dia = HgDialog(self.tr("Edit Plan"), self.vcs, useClient=False) |
159 dia = HgDialog(self.tr("Edit Plan"), self.vcs, useClient=False) |
162 res = dia.startProcess(args, environment=env) |
160 res = dia.startProcess(args) |
163 if res: |
161 if res: |
164 dia.exec() |
162 dia.exec() |
165 res = dia.hasAddOrDelete() |
163 res = dia.hasAddOrDelete() |
166 self.vcs.checkVCSStatus() |
164 self.vcs.checkVCSStatus() |
167 return res |
165 return res |