changeset 6742:0592ae24c470 stable

topic: get changeset node using the designated functions It's a bit wasteful to reach for an entire context if we just want to get the node from revnum, and also using manual slice instead of node.short().
author Anton Shestakov <av6@dwimlabs.net>
date Thu, 14 Mar 2024 16:08:59 -0300
parents cd22d260d8cc
children ab60707314e9
files hgext3rd/topic/flow.py tests/test-topic-flow-reject-untopiced.t
diffstat 2 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/topic/flow.py	Thu Mar 14 14:33:47 2024 -0300
+++ b/hgext3rd/topic/flow.py	Thu Mar 14 16:08:59 2024 -0300
@@ -47,7 +47,8 @@
     untopiced = repo.revs(b'not public() and (%n:) - hidden() - topic()', startnode)
     if untopiced:
         num = len(untopiced)
-        fnode = repo[untopiced.first()].hex()[:10]
+        cl = repo.changelog
+        fnode = node.short(cl.node(untopiced.first()))
         if num == 1:
             msg = _(b"%s") % fnode
         else:
--- a/tests/test-topic-flow-reject-untopiced.t	Thu Mar 14 14:33:47 2024 -0300
+++ b/tests/test-topic-flow-reject-untopiced.t	Thu Mar 14 16:08:59 2024 -0300
@@ -75,7 +75,7 @@
   adding file changes
   transaction abort!
   rollback completed
-  abort: rejecting draft changesets: 4e8b0e0237
+  abort: rejecting draft changesets: 4e8b0e0237c6
   [255]
 
   $ hg push ../server -f
@@ -86,7 +86,7 @@
   adding file changes
   transaction abort!
   rollback completed
-  abort: rejecting draft changesets: 4e8b0e0237
+  abort: rejecting draft changesets: 4e8b0e0237c6
   [255]
 
 Grow the stack with more changesets having topic
@@ -121,7 +121,7 @@
   adding file changes
   transaction abort!
   rollback completed
-  abort: rejecting draft changesets: 4e8b0e0237
+  abort: rejecting draft changesets: 4e8b0e0237c6
   [255]
 
 Testing case when both experimental.topic-mode.server and
@@ -138,7 +138,7 @@
   adding file changes
   transaction abort!
   rollback completed
-  abort: rejecting draft changesets: 4e8b0e0237
+  abort: rejecting draft changesets: 4e8b0e0237c6
   [255]
 
 Turning the changeset public and testing push