975 if base: |
975 if base: |
976 if dest: |
976 if dest: |
977 raise util.Abort(_("--base is incompatible with specifying " |
977 raise util.Abort(_("--base is incompatible with specifying " |
978 "a destination")) |
978 "a destination")) |
979 common = [repo.lookup(rev) for rev in base] |
979 common = [repo.lookup(rev) for rev in base] |
980 outheads = revs and map(repo.lookup, revs) or revs |
980 heads = revs and map(repo.lookup, revs) or revs |
|
981 cg = repo.getbundle('bundle', heads=heads, common=common) |
981 else: |
982 else: |
982 dest = ui.expandpath(dest or 'default-push', dest or 'default') |
983 dest = ui.expandpath(dest or 'default-push', dest or 'default') |
983 dest, branches = hg.parseurl(dest, opts.get('branch')) |
984 dest, branches = hg.parseurl(dest, opts.get('branch')) |
984 other = hg.peer(repo, opts, dest) |
985 other = hg.peer(repo, opts, dest) |
985 revs, checkout = hg.addbranchrevs(repo, other, branches, revs) |
986 revs, checkout = hg.addbranchrevs(repo, other, branches, revs) |
986 heads = revs and map(repo.lookup, revs) or revs |
987 heads = revs and map(repo.lookup, revs) or revs |
987 common, outheads = discovery.findcommonoutgoing(repo, other, |
988 outgoing = discovery.findcommonoutgoing(repo, other, |
988 onlyheads=heads, |
989 onlyheads=heads, |
989 force=opts.get('force')) |
990 force=opts.get('force')) |
990 |
991 cg = repo.getlocalbundle('bundle', outgoing) |
991 cg = repo.getbundle('bundle', common=common, heads=outheads) |
|
992 if not cg: |
992 if not cg: |
993 ui.status(_("no changes found\n")) |
993 ui.status(_("no changes found\n")) |
994 return 1 |
994 return 1 |
995 |
995 |
996 bundletype = opts.get('type', 'bzip2').lower() |
996 bundletype = opts.get('type', 'bzip2').lower() |
5434 if source != dest: |
5434 if source != dest: |
5435 other = hg.peer(repo, {}, dest) |
5435 other = hg.peer(repo, {}, dest) |
5436 commoninc = None |
5436 commoninc = None |
5437 ui.debug('comparing with %s\n' % util.hidepassword(dest)) |
5437 ui.debug('comparing with %s\n' % util.hidepassword(dest)) |
5438 repo.ui.pushbuffer() |
5438 repo.ui.pushbuffer() |
5439 common, outheads = discovery.findcommonoutgoing(repo, other, |
5439 outgoing = discovery.findcommonoutgoing(repo, other, |
5440 commoninc=commoninc) |
5440 commoninc=commoninc) |
5441 repo.ui.popbuffer() |
5441 repo.ui.popbuffer() |
5442 o = repo.changelog.findmissing(common=common, heads=outheads) |
5442 o = outgoing.missing |
5443 if o: |
5443 if o: |
5444 t.append(_('%d outgoing') % len(o)) |
5444 t.append(_('%d outgoing') % len(o)) |
5445 if 'bookmarks' in other.listkeys('namespaces'): |
5445 if 'bookmarks' in other.listkeys('namespaces'): |
5446 lmarks = repo.listkeys('bookmarks') |
5446 lmarks = repo.listkeys('bookmarks') |
5447 rmarks = other.listkeys('bookmarks') |
5447 rmarks = other.listkeys('bookmarks') |