diff tests/test-phases.t @ 45812:976b26bdd0d8

commit: warn the user when a commit already exists Sometimes, a commit will result in an exact match of a preexisting commit, and if that commit isn't a branch head, hg will incorrectly note that it created a new head. Instead, we should warn the user that commit already existed in the repository. In practice, this bug is rather uncommon, and will only occur when the usr explicitly sets the date. Please note that this commit contains an API change to cmdutil.commitstatus() Differential Revision: https://phab.mercurial-scm.org/D9257
author Dan Villiom Podlaski Christiansen <danchr@gmail.com>
date Thu, 29 Oct 2020 13:54:25 +0100
parents 067707e026b4
children bff719525815
line wrap: on
line diff
--- a/tests/test-phases.t	Tue Oct 06 13:34:51 2020 +0200
+++ b/tests/test-phases.t	Thu Oct 29 13:54:25 2020 +0100
@@ -1010,7 +1010,7 @@
   $ hg up -C 1
   0 files updated, 0 files merged, 4 files removed, 0 files unresolved
   $ mkcommit C
-  created new head
+  warning: commit already existed in the repository!
   $ hg phase -r 2
   2: public
 
@@ -1027,6 +1027,7 @@
   7: draft
   $ mkcommit F
   test-debug-phase: new rev 8:  x -> 2
+  warning: commit already existed in the repository!
   test-hook-close-phase: de414268ec5ce2330c590b942fbb5ff0b0ca1a0a:   -> secret
   $ hg phase -r tip
   8: secret
@@ -1037,7 +1038,7 @@
   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
   $ mkcommit H
   test-debug-phase: new rev 5:  x -> 2
-  created new head
+  warning: commit already existed in the repository!
   test-hook-close-phase: a030c6be5127abc010fcbff1851536552e6951a8:   -> secret
   $ hg phase -r 5
   5: secret