diff tests/test-phabricator.t @ 45426:1a5d3e555c70

phabricator: update the hashes in commit messages as they get submitted Due to the sequence of actions (posting, amending the local commit, and then updating the Differential properties), the message in the commit is updated on the initial send but the message displayed in Phabricator is not. It should get updated there if the review is reposted. The data in the Commits tab is accurate for the first `phabsend`. Differential Revision: https://phab.mercurial-scm.org/D8950
author Matt Harbison <matt_harbison@yahoo.com>
date Mon, 24 Aug 2020 18:51:25 -0400
parents b1f2659c1c34
children 294aab57a5f3
line wrap: on
line diff
--- a/tests/test-phabricator.t	Mon Aug 24 18:44:15 2020 -0400
+++ b/tests/test-phabricator.t	Mon Aug 24 18:51:25 2020 -0400
@@ -970,5 +970,37 @@
   Differential Revision: https://phab.mercurial-scm.org/D8388
   
   
+Hashes in the messages are updated automatically as phabsend amends and restacks
+them.  This covers both commits that are posted and descendants that are
+restacked.
 
+  $ cat >> .hg/hgrc << EOF
+  > [experimental]
+  > evolution = all
+  > EOF
+
+  $ echo content > file.txt
+  $ hg ci -m 'base review (generate test for phabsend)'
+  $ echo 'more content' > file.txt
+  $ hg ci -m '133c1c6c6449 is my parent (generate test for phabsend)'
+  $ echo 'even more content' > file.txt
+  $ hg ci -m 'c2874a398f7e is my parent (generate test for phabsend)'
+
+  $ hg phabsend -r 17::18  --test-vcr "$VCR/phabsend-hash-fixes.json"
+  D8945 - created - 133c1c6c6449: base review (generate test for phabsend)
+  D8946 - created - c2874a398f7e: 133c1c6c6449 is my parent (generate test for phabsend)
+  new commits: ['f444f060f4d6']
+  new commits: ['9c9290f945b1']
+  restabilizing 1528c12fa2e4 as b28b20212bd4
+
+  $ hg log -l 3 -Tcompact
+  22[tip]   b28b20212bd4   1970-01-01 00:00 +0000   test
+    9c9290f945b1 is my parent (generate test for phabsend)
+  
+  21   9c9290f945b1   1970-01-01 00:00 +0000   test
+    f444f060f4d6 is my parent (generate test for phabsend)
+  
+  20:16   f444f060f4d6   1970-01-01 00:00 +0000   test
+    base review (generate test for phabsend)
+  
   $ cd ..