Comments
Patch
@@ -215,10 +215,11 @@ def _oldheadssummary(repo, remoteheads,
# - another element of outgoing.missing
# - nullrev
# This explains why the new head are very simple to compute.
r = repo.set('heads(%ln + %ln)', oldheads, outgoing.missing)
newheads = list(c.node() for c in r)
+ # set some unsynced head to issue the "unsynced changes" warning
unsynced = inc and set([None]) or set()
return {None: (oldheads, newheads, unsynced)}
def checkheads(repo, remote, outgoing, remoteheads, newbranch=False, inc=False,
newbookmarks=[]):
@@ -311,16 +312,22 @@ def checkheads(repo, remote, outgoing, r
newhs.add(nh)
else:
newhs = candidate_newhs
unsynced = sorted(h for h in unsyncedheads if h not in discardedheads)
if unsynced:
- if len(unsynced) <= 4 or repo.ui.verbose:
+ if None in unsynced:
+ # old remote, no heads data
+ heads = None
+ elif 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 heads is None:
+ repo.ui.status(_("remote has heads that are "
+ "not known locally\n"))
+ elif branch is None:
repo.ui.status(_("remote has heads that are "
"not known locally: %s\n") % heads)
else:
repo.ui.status(_("remote has heads on branch '%s' that are "
"not known locally: %s\n") % (branch, heads))