##// END OF EJS Templates
discovery: improve "note: unsynced remote changes!" warning...
Mads Kiilerich -
r20501:8a9e0b52 default
parent child Browse files
Show More
@@ -268,7 +268,6 b' def checkheads(repo, remote, outgoing, r'
268 268 # If there are more heads after the push than before, a suitable
269 269 # error message, depending on unsynced status, is displayed.
270 270 error = None
271 unsynced = False
272 271 allmissing = set(outgoing.missing)
273 272 allfuturecommon = set(c.node() for c in repo.set('%ld', outgoing.common))
274 273 allfuturecommon.update(allmissing)
@@ -312,8 +311,15 b' def checkheads(repo, remote, outgoing, r'
312 311 newhs.add(nh)
313 312 else:
314 313 newhs = candidate_newhs
315 if [h for h in unsyncedheads if h not in discardedheads]:
316 unsynced = True
314 unsynced = sorted(h for h in unsyncedheads if h not in discardedheads)
315 if unsynced:
316 heads = ' '.join(short(h) for h in unsynced)
317 if branch is None:
318 repo.ui.warn(_("remote has heads that are "
319 "not known locally: %s\n") % heads)
320 else:
321 repo.ui.warn(_("remote has heads on branch '%s' that are "
322 "not known locally: %s\n") % (branch, heads))
317 323 if remoteheads is None:
318 324 if len(newhs) > 1:
319 325 dhs = list(newhs)
@@ -350,7 +356,3 b' def checkheads(repo, remote, outgoing, r'
350 356 repo.ui.note((" %s\n") % short(h))
351 357 if error:
352 358 raise util.Abort(error, hint=hint)
353
354 # 6. Check for unsynced changes on involved branches.
355 if unsynced:
356 repo.ui.warn(_("note: unsynced remote changes!\n"))
@@ -22,6 +22,7 b''
22 22 $ hg push ../a
23 23 pushing to ../a
24 24 searching for changes
25 remote has heads on branch 'default' that are not known locally: 1c9246a22a0a
25 26 abort: push creates new remote head 1e108cc5548c!
26 27 (pull and merge or see "hg help push" for details about pushing new heads)
27 28 [255]
@@ -35,6 +36,7 b''
35 36 query 2; still undecided: 1, sample size is: 1
36 37 2 total queries
37 38 listing keys for "bookmarks"
39 remote has heads on branch 'default' that are not known locally: 1c9246a22a0a
38 40 new remote heads on branch 'default':
39 41 1e108cc5548c
40 42 abort: push creates new remote head 1e108cc5548c!
@@ -405,6 +407,7 b' multiple new heads:'
405 407 $ hg -R i push h
406 408 pushing to h
407 409 searching for changes
410 remote has heads on branch 'default' that are not known locally: ce4212fc8847
408 411 abort: push creates new remote head 97bd0c84d346!
409 412 (pull and merge or see "hg help push" for details about pushing new heads)
410 413 [255]
@@ -223,7 +223,7 b' push should succeed even though it has a'
223 223 $ hg push
224 224 pushing to ssh://user@dummy/remote
225 225 searching for changes
226 note: unsynced remote changes!
226 remote has heads on branch 'default' that are not known locally: 6c0482d977a3
227 227 remote: adding changesets
228 228 remote: adding manifests
229 229 remote: adding file changes
General Comments 0
You need to be logged in to leave comments. Login now