815 |
815 |
816 remoterevs, _checkout = hg.addbranchrevs(repo, remote, branches, revs=None) |
816 remoterevs, _checkout = hg.addbranchrevs(repo, remote, branches, revs=None) |
817 localrevs = opts['rev'] |
817 localrevs = opts['rev'] |
818 common, hds = doit(localrevs, remoterevs) |
818 common, hds = doit(localrevs, remoterevs) |
819 |
819 |
|
820 # compute all statistics |
820 common = set(common) |
821 common = set(common) |
821 rheads = set(hds) |
822 rheads = set(hds) |
822 lheads = set(repo.heads()) |
823 lheads = set(repo.heads()) |
|
824 |
|
825 data = {} |
|
826 data['nb-common'] = len(common) |
|
827 data['nb-common-local'] = len(common & lheads) |
|
828 data['nb-common-remote'] = len(common & rheads) |
|
829 data['nb-local'] = len(lheads) |
|
830 data['nb-local-missing'] = data['nb-local'] - data['nb-common-local'] |
|
831 data['nb-remote'] = len(rheads) |
|
832 data['nb-remote-unknown'] = data['nb-remote'] - data['nb-common-remote'] |
|
833 data['nb-revs'] = len(repo.revs('all()')) |
|
834 data['nb-revs-common'] = len(repo.revs('::%ln', common)) |
|
835 data['nb-revs-missing'] = data['nb-revs'] - data['nb-revs-common'] |
|
836 |
|
837 # display discovery summary |
|
838 ui.write(("heads summary:\n")) |
|
839 ui.write((" total common heads: %(nb-common)9d\n") % data) |
|
840 ui.write((" also local heads: %(nb-common-local)9d\n") % data) |
|
841 ui.write((" also remote heads: %(nb-common-remote)9d\n") % data) |
|
842 ui.write((" local heads: %(nb-local)9d\n") % data) |
|
843 ui.write((" common: %(nb-common-local)9d\n") % data) |
|
844 ui.write((" missing: %(nb-local-missing)9d\n") % data) |
|
845 ui.write((" remote heads: %(nb-remote)9d\n") % data) |
|
846 ui.write((" common: %(nb-common-remote)9d\n") % data) |
|
847 ui.write((" unknown: %(nb-remote-unknown)9d\n") % data) |
|
848 ui.write(("local changesets: %(nb-revs)9d\n") % data) |
|
849 ui.write((" common: %(nb-revs-common)9d\n") % data) |
|
850 ui.write((" missing: %(nb-revs-missing)9d\n") % data) |
|
851 |
823 ui.write(("common heads: %s\n") % |
852 ui.write(("common heads: %s\n") % |
824 " ".join(sorted(short(n) for n in common))) |
853 " ".join(sorted(short(n) for n in common))) |
825 if lheads <= common: |
854 if lheads <= common: |
826 ui.write(("local is subset\n")) |
855 ui.write(("local is subset\n")) |
827 elif rheads <= common: |
856 elif rheads <= common: |