Show More
@@ -862,13 +862,11 b' def _dobackout(ui, repo, node=None, rev=' | |||||
862 |
|
862 | |||
863 | ui.status( |
|
863 | ui.status( | |
864 | _(b'changeset %s backs out changeset %s\n') |
|
864 | _(b'changeset %s backs out changeset %s\n') | |
865 |
% (nice( |
|
865 | % (nice(newnode), nice(node)) | |
866 | ) |
|
866 | ) | |
867 | if opts.get(b'merge') and op1 != node: |
|
867 | if opts.get(b'merge') and op1 != node: | |
868 | hg.clean(repo, op1, show_stats=False) |
|
868 | hg.clean(repo, op1, show_stats=False) | |
869 | ui.status( |
|
869 | ui.status(_(b'merging with changeset %s\n') % nice(newnode)) | |
870 | _(b'merging with changeset %s\n') % nice(repo.changelog.tip()) |
|
|||
871 | ) |
|
|||
872 | overrides = {(b'ui', b'forcemerge'): opts.get(b'tool', b'')} |
|
870 | overrides = {(b'ui', b'forcemerge'): opts.get(b'tool', b'')} | |
873 | with ui.configoverride(overrides, b'backout'): |
|
871 | with ui.configoverride(overrides, b'backout'): | |
874 | return hg.merge(repo[b'tip']) |
|
872 | return hg.merge(repo[b'tip']) |
@@ -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 |
@@ -69,7 +69,7 b' def pinnedrevs(repo):' | |||||
69 | from . import mergestate |
|
69 | from . import mergestate | |
70 |
|
70 | |||
71 | ms = mergestate.mergestate.read(repo) |
|
71 | ms = mergestate.mergestate.read(repo) | |
72 | if ms.active(): |
|
72 | if ms.active() and ms.unresolvedcount(): | |
73 | for node in (ms.local, ms.other): |
|
73 | for node in (ms.local, ms.other): | |
74 | rev = cl.index.get_rev(node) |
|
74 | rev = cl.index.get_rev(node) | |
75 | if rev is not None: |
|
75 | if rev is not None: |
@@ -1661,7 +1661,9 b' class ui(object):' | |||||
1661 | if not r: |
|
1661 | if not r: | |
1662 | r = default |
|
1662 | r = default | |
1663 | if self.configbool(b'ui', b'promptecho'): |
|
1663 | if self.configbool(b'ui', b'promptecho'): | |
1664 | self._writemsg(self._fmsgout, r, b"\n", type=b'promptecho') |
|
1664 | self._writemsg( | |
|
1665 | self._fmsgout, r or b'', b"\n", type=b'promptecho' | |||
|
1666 | ) | |||
1665 | return r |
|
1667 | return r | |
1666 | except EOFError: |
|
1668 | except EOFError: | |
1667 | raise error.ResponseExpected() |
|
1669 | raise error.ResponseExpected() |
@@ -96,6 +96,13 b' class passwordmgr(object):' | |||||
96 | if not passwd: |
|
96 | if not passwd: | |
97 | passwd = self.ui.getpass() |
|
97 | passwd = self.ui.getpass() | |
98 |
|
98 | |||
|
99 | # As of Python 3.8, the default implementation of | |||
|
100 | # AbstractBasicAuthHandler.retry_http_basic_auth() assumes the user | |||
|
101 | # is set if pw is not None. This means (None, str) is not a valid | |||
|
102 | # return type of find_user_password(). | |||
|
103 | if user is None: | |||
|
104 | return None, None | |||
|
105 | ||||
99 | self.passwddb.add_password(realm, authuri, user, passwd) |
|
106 | self.passwddb.add_password(realm, authuri, user, passwd) | |
100 | self._writedebug(user, passwd) |
|
107 | self._writedebug(user, passwd) | |
101 | return (pycompat.strurl(user), pycompat.strurl(passwd)) |
|
108 | return (pycompat.strurl(user), pycompat.strurl(passwd)) |
@@ -806,3 +806,18 b' Test usage of `hg resolve` in case of co' | |||||
806 | $ hg backout --merge --no-commit 2 |
|
806 | $ hg backout --merge --no-commit 2 | |
807 | abort: cannot specify both --no-commit and --merge |
|
807 | abort: cannot specify both --no-commit and --merge | |
808 | [255] |
|
808 | [255] | |
|
809 | ||||
|
810 | Ensure that backout out the same changeset twice performs correctly: | |||
|
811 | ||||
|
812 | $ hg backout 2 | |||
|
813 | removing 3 | |||
|
814 | changeset 3:8f188de730d9 backs out changeset 2:cccc23d9d68f | |||
|
815 | $ echo 4 > 4 | |||
|
816 | $ hg ci -A -m 4 | |||
|
817 | adding 4 | |||
|
818 | $ hg up 2 | |||
|
819 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |||
|
820 | $ hg backout 2 | |||
|
821 | removing 3 | |||
|
822 | created new head | |||
|
823 | changeset 3:8f188de730d9 backs out changeset 2:cccc23d9d68f |
@@ -192,6 +192,34 b' test http authentication' | |||||
192 | $ hg id http://localhost:$HGPORT2/ |
|
192 | $ hg id http://localhost:$HGPORT2/ | |
193 | abort: http authorization required for http://localhost:$HGPORT2/ |
|
193 | abort: http authorization required for http://localhost:$HGPORT2/ | |
194 | [255] |
|
194 | [255] | |
|
195 | $ hg id --config ui.interactive=true --debug http://localhost:$HGPORT2/ | |||
|
196 | using http://localhost:$HGPORT2/ | |||
|
197 | sending capabilities command | |||
|
198 | http authorization required for http://localhost:$HGPORT2/ | |||
|
199 | realm: mercurial | |||
|
200 | user: abort: response expected | |||
|
201 | [255] | |||
|
202 | $ cat <<'EOF' | hg id --config ui.interactive=true --config ui.nontty=true --debug http://localhost:$HGPORT2/ | |||
|
203 | > | |||
|
204 | > EOF | |||
|
205 | using http://localhost:$HGPORT2/ | |||
|
206 | sending capabilities command | |||
|
207 | http authorization required for http://localhost:$HGPORT2/ | |||
|
208 | realm: mercurial | |||
|
209 | user: | |||
|
210 | password: abort: response expected | |||
|
211 | [255] | |||
|
212 | $ cat <<'EOF' | hg id --config ui.interactive=true --config ui.nontty=true --debug http://localhost:$HGPORT2/ | |||
|
213 | > | |||
|
214 | > | |||
|
215 | > EOF | |||
|
216 | using http://localhost:$HGPORT2/ | |||
|
217 | sending capabilities command | |||
|
218 | http authorization required for http://localhost:$HGPORT2/ | |||
|
219 | realm: mercurial | |||
|
220 | user: | |||
|
221 | password: abort: authorization failed | |||
|
222 | [255] | |||
195 |
$ |
|
223 | $ hg id --config ui.interactive=true --config extensions.getpass=get_pass.py http://user@localhost:$HGPORT2/ | |
196 | http authorization required for http://localhost:$HGPORT2/ |
|
224 | http authorization required for http://localhost:$HGPORT2/ | |
197 | realm: mercurial |
|
225 | realm: mercurial | |
@@ -360,6 +388,9 b' test http authentication' | |||||
360 | "GET /?cmd=capabilities HTTP/1.1" 401 - |
|
388 | "GET /?cmd=capabilities HTTP/1.1" 401 - | |
361 | "GET /?cmd=capabilities HTTP/1.1" 401 - |
|
389 | "GET /?cmd=capabilities HTTP/1.1" 401 - | |
362 | "GET /?cmd=capabilities HTTP/1.1" 401 - |
|
390 | "GET /?cmd=capabilities HTTP/1.1" 401 - | |
|
391 | "GET /?cmd=capabilities HTTP/1.1" 401 - | |||
|
392 | "GET /?cmd=capabilities HTTP/1.1" 401 - | |||
|
393 | "GET /?cmd=capabilities HTTP/1.1" 401 - | |||
363 | "GET /?cmd=capabilities HTTP/1.1" 200 - |
|
394 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
364 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
395 | "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull | |
365 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
|
396 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull |
@@ -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 .. |
@@ -176,6 +176,48 b' is filtered and requires --hidden.' | |||||
176 | warning: conflicts while merging A! (edit, then use 'hg resolve --mark') |
|
176 | warning: conflicts while merging A! (edit, then use 'hg resolve --mark') | |
177 | [1] |
|
177 | [1] | |
178 |
|
178 | |||
|
179 | An unresolved conflict will pin the obsolete revision | |||
|
180 | ||||
|
181 | $ hg log -G -Tcompact | |||
|
182 | % 5[tip] 071d07019675 1970-01-01 00:00 +0000 test | |||
|
183 | | F | |||
|
184 | | | |||
|
185 | o 4 ae36e8e3dfd7 1970-01-01 00:00 +0000 test | |||
|
186 | | E | |||
|
187 | | | |||
|
188 | o 3:0 46b37eabc604 1970-01-01 00:00 +0000 test | |||
|
189 | | D | |||
|
190 | | | |||
|
191 | | @ 2 965c486023db 1970-01-01 00:00 +0000 test | |||
|
192 | | | C | |||
|
193 | | | | |||
|
194 | | o 1 27547f69f254 1970-01-01 00:00 +0000 test | |||
|
195 | |/ B | |||
|
196 | | | |||
|
197 | o 0 4a2df7238c3b 1970-01-01 00:00 +0000 test | |||
|
198 | A | |||
|
199 | ||||
|
200 | ||||
|
201 | But resolving the conflicts will unpin it | |||
|
202 | ||||
|
203 | $ hg resolve -m A | |||
|
204 | (no more unresolved files) | |||
|
205 | $ hg log -G -Tcompact | |||
|
206 | o 4[tip] ae36e8e3dfd7 1970-01-01 00:00 +0000 test | |||
|
207 | | E | |||
|
208 | | | |||
|
209 | o 3:0 46b37eabc604 1970-01-01 00:00 +0000 test | |||
|
210 | | D | |||
|
211 | | | |||
|
212 | | @ 2 965c486023db 1970-01-01 00:00 +0000 test | |||
|
213 | | | C | |||
|
214 | | | | |||
|
215 | | o 1 27547f69f254 1970-01-01 00:00 +0000 test | |||
|
216 | |/ B | |||
|
217 | | | |||
|
218 | o 0 4a2df7238c3b 1970-01-01 00:00 +0000 test | |||
|
219 | A | |||
|
220 | ||||
179 | $ hg up -C -q . |
|
221 | $ hg up -C -q . | |
180 |
|
222 | |||
181 | $ cd .. |
|
223 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now