Mercurial > public > mercurial-scm > hg-stable
diff tests/test-commit-amend.t @ 29181:dae38633eba8 stable
localrepo: prevent executable-bit only changes from being lost on amend
If you have just executable-bit change and amend it twice it will vanish:
* After the first amend the commit will have the proper executable bit set
in manifest but it won't have the the file on the list of files in
changelog.
* The second amend will read the wrong list of files from changelog and it
will copy the manifest entry from parent for this file.
* Voila! The change is lost.
This change repairs the bug in localrepo causing this and adds a test for it.
author | Mateusz Kwapich <mitrandir@fb.com> |
---|---|
date | Thu, 19 May 2016 14:35:22 -0700 |
parents | d7af9b4ae7dd |
children | 978b907d9b36 |
line wrap: on
line diff
--- a/tests/test-commit-amend.t Sat May 21 02:48:51 2016 +0900 +++ b/tests/test-commit-amend.t Thu May 19 14:35:22 2016 -0700 @@ -1156,3 +1156,21 @@ rev offset length delta linkrev nodeid p1 p2 0 0 88 -1 3 34a4d536c0c0 000000000000 000000000000 +Test if amend preserves executable bit changes + $ chmod +x newdirname/commonfile.py + $ hg ci -m chmod + $ hg ci --amend -m "chmod amended" + $ hg ci --amend -m "chmod amended second time" + $ hg log -p --git -r . + changeset: 8:b1326f52dddf + branch: newdirname + tag: tip + parent: 5:7fd235f7cb2f + user: test + date: Thu Jan 01 00:00:00 1970 +0000 + summary: chmod amended second time + + diff --git a/newdirname/commonfile.py b/newdirname/commonfile.py + old mode 100644 + new mode 100755 +