eol: look up partial nodeid as partial nodeid
authorMartin von Zweigbergk <martinvonz@google.com>
Fri, 06 Apr 2018 09:53:17 -0700
changeset 37507 9b16a67cef56
parent 37506 c4131138eadb
child 37508 30a7b32897f1
eol: look up partial nodeid as partial nodeid Similar reasoning as the previous patch. For some reason the hook gives us a partial nodeid, so we need to resolve that to a full nodeid. Differential Revision: https://phab.mercurial-scm.org/D3159
hgext/eol.py
tests/test-blackbox.t
--- a/hgext/eol.py	Fri Apr 06 09:43:17 2018 -0700
+++ b/hgext/eol.py	Fri Apr 06 09:53:17 2018 -0700
@@ -103,6 +103,7 @@
     match,
     pycompat,
     registrar,
+    scmutil,
     util,
 )
 from mercurial.utils import (
@@ -299,7 +300,8 @@
 hook = checkheadshook
 
 def preupdate(ui, repo, hooktype, parent1, parent2):
-    repo.loadeol([parent1])
+    p1node = scmutil.resolvepartialhexnodeid(repo, parent1)
+    repo.loadeol([p1node])
     return False
 
 def uisetup(ui):
--- a/tests/test-blackbox.t	Fri Apr 06 09:43:17 2018 -0700
+++ b/tests/test-blackbox.t	Fri Apr 06 09:53:17 2018 -0700
@@ -157,14 +157,13 @@
   > # (in addition, keeping it requires extra care for fsmonitor)
   > eol=!
   > EOF
-  $ hg blackbox -l 6
+  $ hg blackbox -l 5
   1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> update (no-chg !)
-  1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> writing .hg/cache/tags2-visible with 0 tags
   1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> pythonhook-preupdate: hgext.eol.preupdate finished in * seconds (glob)
   1970/01/01 00:00:00 bob @d02f48003e62c24e2659d97d30f2a83abe5d5d51 (5000)> exthook-update: echo hooked finished in * seconds (glob)
   1970/01/01 00:00:00 bob @d02f48003e62c24e2659d97d30f2a83abe5d5d51 (5000)> update exited 0 after * seconds (glob)
   1970/01/01 00:00:00 bob @d02f48003e62c24e2659d97d30f2a83abe5d5d51 (5000)> serve --cmdserver chgunix --address $TESTTMP.chgsock/server.* --daemon-postexec 'chdir:/' (glob) (chg !)
-  1970/01/01 00:00:00 bob @d02f48003e62c24e2659d97d30f2a83abe5d5d51 (5000)> blackbox -l 6
+  1970/01/01 00:00:00 bob @d02f48003e62c24e2659d97d30f2a83abe5d5d51 (5000)> blackbox -l 5
 
 log rotation