Show More
@@ -293,11 +293,14 b' def checkheads(repo, remote, outgoing, r' | |||||
293 | # more tricky for unsynced changes. |
|
293 | # more tricky for unsynced changes. | |
294 | newhs = set() |
|
294 | newhs = set() | |
295 | for nh in candidate_newhs: |
|
295 | for nh in candidate_newhs: | |
296 | for suc in obsolete.anysuccessors(repo.obsstore, nh): |
|
296 | if repo[nh].phase() <= phases.public: | |
297 | if suc != nh and suc in allmissing: |
|
297 | newhs.add(nh) | |
298 | break |
|
|||
299 | else: |
|
298 | else: | |
300 | newhs.add(nh) |
|
299 | for suc in obsolete.anysuccessors(repo.obsstore, nh): | |
|
300 | if suc != nh and suc in allmissing: | |||
|
301 | break | |||
|
302 | else: | |||
|
303 | newhs.add(nh) | |||
301 | else: |
|
304 | else: | |
302 | newhs = candidate_newhs |
|
305 | newhs = candidate_newhs | |
303 | if len(newhs) > len(oldhs): |
|
306 | if len(newhs) > len(oldhs): |
@@ -71,13 +71,72 b' Push should not warn about creating new ' | |||||
71 | adding file changes |
|
71 | adding file changes | |
72 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
72 | added 1 changesets with 1 changes to 1 files (+1 heads) | |
73 |
|
73 | |||
74 | old head is obsolete but replacement in not pushed |
|
74 | old head is now public (public local version) | |
|
75 | ============================================= | |||
|
76 | ||||
|
77 | setup | |||
|
78 | ||||
|
79 | $ rm -fr ../remote | |||
|
80 | $ cp -r ../backup1 ../remote | |||
|
81 | $ hg -R ../remote phase --public c70b08862e08 | |||
|
82 | $ hg pull -v | |||
|
83 | pulling from $TESTTMP/remote | |||
|
84 | searching for changes | |||
|
85 | no changes found | |||
|
86 | $ hg glog --hidden | |||
|
87 | @ 71e3228bffe1 (draft) add new | |||
|
88 | | | |||
|
89 | | o c70b08862e08 (public) add old | |||
|
90 | |/ | |||
|
91 | o b4952fcf48cf (public) add base | |||
|
92 | ||||
|
93 | ||||
|
94 | Abort: old will still be an head because it's public. | |||
|
95 | ||||
|
96 | $ hg push | |||
|
97 | pushing to $TESTTMP/remote | |||
|
98 | searching for changes | |||
|
99 | abort: push creates new remote head 71e3228bffe1! | |||
|
100 | (did you forget to merge? use push -f to force) | |||
|
101 | [255] | |||
|
102 | ||||
|
103 | old head is now public (public remote version) | |||
|
104 | ============================================== | |||
|
105 | ||||
|
106 | TODO: Not implemented yet. | |||
|
107 | ||||
|
108 | # setup | |||
|
109 | # | |||
|
110 | # $ rm -fr ../remote | |||
|
111 | # $ cp -r ../backup1 ../remote | |||
|
112 | # $ hg -R ../remote phase --public c70b08862e08 | |||
|
113 | # $ hg phase --draft --force c70b08862e08 | |||
|
114 | # $ hg glog --hidden | |||
|
115 | # @ 71e3228bffe1 (draft) add new | |||
|
116 | # | | |||
|
117 | # | x c70b08862e08 (draft) add old | |||
|
118 | # |/ | |||
|
119 | # o b4952fcf48cf (public) add base | |||
|
120 | # | |||
|
121 | # | |||
|
122 | # | |||
|
123 | # Abort: old will still be an head because it's public. | |||
|
124 | # | |||
|
125 | # $ hg push | |||
|
126 | # pushing to $TESTTMP/remote | |||
|
127 | # searching for changes | |||
|
128 | # abort: push creates new remote head 71e3228bffe1! | |||
|
129 | # (did you forget to merge? use push -f to force) | |||
|
130 | # [255] | |||
|
131 | ||||
|
132 | old head is obsolete but replacement is not pushed | |||
75 |
|
|
133 | ================================================== | |
76 |
|
134 | |||
77 | setup |
|
135 | setup | |
78 |
|
136 | |||
79 | $ rm -fr ../remote |
|
137 | $ rm -fr ../remote | |
80 | $ cp -r ../backup1 ../remote |
|
138 | $ cp -r ../backup1 ../remote | |
|
139 | $ hg phase --draft --force '(0::) - 0' | |||
81 | $ hg up -q '.^' |
|
140 | $ hg up -q '.^' | |
82 | $ mkcommit other |
|
141 | $ mkcommit other | |
83 | created new head |
|
142 | created new head |
General Comments 0
You need to be logged in to leave comments.
Login now