Skip to content
Snippets Groups Projects
Commit 56a04085 authored by Mads Kiilerich's avatar Mads Kiilerich
Browse files

discovery: don't report all "unsynced" remote heads (issue4230)

8a9e0b523d2d made discovery more helpful - too helpful for some extreme use
cases.

Instead, we arbitrarily limit the list it at 4 and add 'or more'.
parent cb4223c6
No related branches found
No related tags found
No related merge requests found
...@@ -313,7 +313,11 @@ ...@@ -313,7 +313,11 @@
newhs = candidate_newhs newhs = candidate_newhs
unsynced = sorted(h for h in unsyncedheads if h not in discardedheads) unsynced = sorted(h for h in unsyncedheads if h not in discardedheads)
if unsynced: if unsynced:
heads = ' '.join(short(h) for h in unsynced) if len(unsynced) <= 4 or repo.ui.verbose:
heads = ' '.join(short(h) for h in unsynced)
else:
heads = (' '.join(short(h) for h in unsynced[:4]) +
' ' + _("and %s others") % (len(unsynced) - 4))
if branch is None: if branch is None:
repo.ui.status(_("remote has heads that are " repo.ui.status(_("remote has heads that are "
"not known locally: %s\n") % heads) "not known locally: %s\n") % heads)
......
...@@ -378,7 +378,7 @@ ...@@ -378,7 +378,7 @@
added 3 changesets with 3 changes to 1 files (+1 heads) added 3 changesets with 3 changes to 1 files (+1 heads)
Checking prepush logic does not allow silently pushing Checking prepush logic does not allow silently pushing
multiple new heads: multiple new heads but also doesn't report too many heads:
$ cd .. $ cd ..
$ hg init h $ hg init h
...@@ -404,6 +404,8 @@ ...@@ -404,6 +404,8 @@
adding c adding c
created new head created new head
$ for i in `seq 3`; do hg -R h up -q 0; echo $i > h/b; hg -R h ci -qAm$i; done
$ hg -R i push h $ hg -R i push h
pushing to h pushing to h
searching for changes searching for changes
...@@ -407,7 +409,24 @@ ...@@ -407,7 +409,24 @@
$ hg -R i push h $ hg -R i push h
pushing to h pushing to h
searching for changes searching for changes
remote has heads on branch 'default' that are not known locally: ce4212fc8847 remote has heads on branch 'default' that are not known locally: 534543e22c29 764f8ec07b96 afe7cc7679f5 ce4212fc8847
abort: push creates new remote head 97bd0c84d346!
(pull and merge or see "hg help push" for details about pushing new heads)
[255]
$ hg -R h up -q 0; echo x > h/b; hg -R h ci -qAmx
$ hg -R i push h
pushing to h
searching for changes
remote has heads on branch 'default' that are not known locally: 18ddb72c4590 534543e22c29 764f8ec07b96 afe7cc7679f5 and 1 others
abort: push creates new remote head 97bd0c84d346!
(pull and merge or see "hg help push" for details about pushing new heads)
[255]
$ hg -R i push h -v
pushing to h
searching for changes
remote has heads on branch 'default' that are not known locally: 18ddb72c4590 534543e22c29 764f8ec07b96 afe7cc7679f5 ce4212fc8847
new remote heads on branch 'default':
97bd0c84d346
abort: push creates new remote head 97bd0c84d346! abort: push creates new remote head 97bd0c84d346!
(pull and merge or see "hg help push" for details about pushing new heads) (pull and merge or see "hg help push" for details about pushing new heads)
[255] [255]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment