changeset 51630:513597087b89

branching: merge stable into default
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 10 Jun 2024 12:12:56 +0200
parents 33bcb1dd4101 (current diff) eb11153c1698 (diff)
children bf1d26bd5b6a
files mercurial/dirstate.py
diffstat 2 files changed, 9 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/histedit.py	Thu May 23 11:05:11 2024 +0200
+++ b/hgext/histedit.py	Mon Jun 10 12:12:56 2024 +0200
@@ -1581,14 +1581,16 @@
 
     def change_action(self, pos, action):
         """Change the action state on the given position to the new action"""
-        assert 0 <= pos < len(self.rules)
-        self.rules[pos].action = action
+        rule_pos = self.display_pos_to_rule_pos(pos)
+        assert 0 <= rule_pos < len(self.rules)
+        self.rules[rule_pos].action = action
 
     def cycle_action(self, pos, next=False):
         """Changes the action state the next or the previous action from
         the action list"""
-        assert 0 <= pos < len(self.rules)
-        current = self.rules[pos].action
+        rule_pos = self.display_pos_to_rule_pos(pos)
+        assert 0 <= rule_pos < len(self.rules)
+        current = self.rules[rule_pos].action
 
         assert current in KEY_LIST
 
@@ -1597,6 +1599,8 @@
             index += 1
         else:
             index -= 1
+        # using pos instead of rule_pos because change_action() also calls
+        # display_pos_to_rule_pos()
         self.change_action(pos, KEY_LIST[index % len(KEY_LIST)])
 
     def change_view(self, delta, unit):
--- a/mercurial/dirstate.py	Thu May 23 11:05:11 2024 +0200
+++ b/mercurial/dirstate.py	Mon Jun 10 12:12:56 2024 +0200
@@ -1597,7 +1597,7 @@
                         )
                     )
 
-        for fn, message in bad:
+        for fn, message in sorted(bad):
             matcher.bad(fn, encoding.strtolocal(message))
 
         status = scmutil.status(