##// END OF EJS Templates
Make "hg incoming -r revision_number" work for remote repos (issue566)...
Thomas Arendsen Hein -
r4451:671158f0 default
parent child Browse files
Show More
@@ -1554,7 +1554,14 b' def incoming(ui, repo, source="default",'
1554 setremoteconfig(ui, opts)
1554 setremoteconfig(ui, opts)
1555
1555
1556 other = hg.repository(ui, source)
1556 other = hg.repository(ui, source)
1557 incoming = repo.findincoming(other, force=opts["force"])
1557 revs = None
1558 if opts['rev']:
1559 if 'lookup' in other.capabilities:
1560 revs = [other.lookup(rev) for rev in opts['rev']]
1561 else:
1562 error = _("Other repository doesn't support revision lookup, so a rev cannot be specified.")
1563 raise util.Abort(error)
1564 incoming = repo.findincoming(other, heads=revs, force=opts["force"])
1558 if not incoming:
1565 if not incoming:
1559 ui.status(_("no changes found\n"))
1566 ui.status(_("no changes found\n"))
1560 return
1567 return
@@ -1564,7 +1571,12 b' def incoming(ui, repo, source="default",'
1564 fname = opts["bundle"]
1571 fname = opts["bundle"]
1565 if fname or not other.local():
1572 if fname or not other.local():
1566 # create a bundle (uncompressed if other repo is not local)
1573 # create a bundle (uncompressed if other repo is not local)
1567 cg = other.changegroup(incoming, "incoming")
1574 if revs is None:
1575 cg = other.changegroup(incoming, "incoming")
1576 else:
1577 if 'changegroupsubset' not in other.capabilities:
1578 raise util.Abort(_("Partial incoming cannot be done because other repository doesn't support changegroupsubset."))
1579 cg = other.changegroupsubset(incoming, revs, 'incoming')
1568 bundletype = other.local() and "HG10BZ" or "HG10UN"
1580 bundletype = other.local() and "HG10BZ" or "HG10UN"
1569 fname = cleanup = changegroup.writebundle(cg, fname, bundletype)
1581 fname = cleanup = changegroup.writebundle(cg, fname, bundletype)
1570 # keep written bundle?
1582 # keep written bundle?
@@ -1574,9 +1586,6 b' def incoming(ui, repo, source="default",'
1574 # use the created uncompressed bundlerepo
1586 # use the created uncompressed bundlerepo
1575 other = bundlerepo.bundlerepository(ui, repo.root, fname)
1587 other = bundlerepo.bundlerepository(ui, repo.root, fname)
1576
1588
1577 revs = None
1578 if opts['rev']:
1579 revs = [other.lookup(rev) for rev in opts['rev']]
1580 o = other.changelog.nodesbetween(incoming, revs)[0]
1589 o = other.changelog.nodesbetween(incoming, revs)[0]
1581 if opts['newest_first']:
1590 if opts['newest_first']:
1582 o.reverse()
1591 o.reverse()
@@ -71,6 +71,7 b' date: Mon Jan 12 13:46:40 1970 +0'
71 summary: 3
71 summary: 3
72
72
73 changeset: 4:1f3a964b6022
73 changeset: 4:1f3a964b6022
74 tag: tip
74 user: test
75 user: test
75 date: Mon Jan 12 13:46:40 1970 +0000
76 date: Mon Jan 12 13:46:40 1970 +0000
76 summary: 4
77 summary: 4
General Comments 0
You need to be logged in to leave comments. Login now