##// END OF EJS Templates
commit: don't change phases for preexisting commits...
Dan Villiom Podlaski Christiansen -
r46379:067707e0 stable
parent child Browse files
Show More
@@ -79,6 +79,9 b' def commitctx(repo, ctx, error=False, or'
79 if repo.changelog._copiesstorage == b'extra':
79 if repo.changelog._copiesstorage == b'extra':
80 extra = _extra_with_copies(repo, extra, files)
80 extra = _extra_with_copies(repo, extra, files)
81
81
82 # save the tip to check whether we actually committed anything
83 oldtip = repo.changelog.tiprev()
84
82 # update changelog
85 # update changelog
83 repo.ui.note(_(b"committing changelog\n"))
86 repo.ui.note(_(b"committing changelog\n"))
84 repo.changelog.delayupdate(tr)
87 repo.changelog.delayupdate(tr)
@@ -99,7 +102,11 b' def commitctx(repo, ctx, error=False, or'
99 )
102 )
100 # set the new commit is proper phase
103 # set the new commit is proper phase
101 targetphase = subrepoutil.newcommitphase(repo.ui, ctx)
104 targetphase = subrepoutil.newcommitphase(repo.ui, ctx)
102 if targetphase:
105
106 # prevent unmarking changesets as public on recommit
107 waspublic = oldtip == repo.changelog.tiprev() and not repo[n].phase()
108
109 if targetphase and not waspublic:
103 # retract boundary do not alter parent changeset.
110 # retract boundary do not alter parent changeset.
104 # if a parent have higher the resulting phase will
111 # if a parent have higher the resulting phase will
105 # be compliant anyway
112 # be compliant anyway
@@ -999,3 +999,55 b' Commit is hidden as expected'
999 date: Thu Jan 01 00:00:00 1970 +0000
999 date: Thu Jan 01 00:00:00 1970 +0000
1000 summary: A
1000 summary: A
1001
1001
1002 $ cd ..
1003
1004 Recommitting an exact match of a public commit shouldn't change it to
1005 draft:
1006
1007 $ cd initialrepo
1008 $ hg phase -r 2
1009 2: public
1010 $ hg up -C 1
1011 0 files updated, 0 files merged, 4 files removed, 0 files unresolved
1012 $ mkcommit C
1013 created new head
1014 $ hg phase -r 2
1015 2: public
1016
1017 Same, but for secret:
1018
1019 $ hg up 7
1020 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1021 $ mkcommit F -s
1022 test-debug-phase: new rev 8: x -> 2
1023 test-hook-close-phase: de414268ec5ce2330c590b942fbb5ff0b0ca1a0a: -> secret
1024 $ hg up 7
1025 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1026 $ hg phase
1027 7: draft
1028 $ mkcommit F
1029 test-debug-phase: new rev 8: x -> 2
1030 test-hook-close-phase: de414268ec5ce2330c590b942fbb5ff0b0ca1a0a: -> secret
1031 $ hg phase -r tip
1032 8: secret
1033
1034 But what about obsoleted changesets?
1035
1036 $ hg up 4
1037 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1038 $ mkcommit H
1039 test-debug-phase: new rev 5: x -> 2
1040 created new head
1041 test-hook-close-phase: a030c6be5127abc010fcbff1851536552e6951a8: -> secret
1042 $ hg phase -r 5
1043 5: secret
1044 $ hg par
1045 changeset: 5:a030c6be5127
1046 user: test
1047 date: Thu Jan 01 00:00:00 1970 +0000
1048 obsolete: pruned
1049 summary: H
1050
1051 $ hg up tip
1052 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
1053 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now