comparison mercurial/revset.py @ 17913:03e552aaae67

bundle: add revset expression to show bundle contents (issue3487) bundle() revset expression returns all changes that are present in the bundle file (no matter whether they are in the repo or not). Bundle file should be specified via -R option.
author Tomasz Kleczek <tkleczek@fb.com>
date Wed, 31 Oct 2012 16:23:23 -0700
parents d8905e2c1301
children 49c85541617b
comparison
equal deleted inserted replaced
17908:42f8ee0e04ac 17913:03e552aaae67
440 # i18n: "bumped" is a keyword 440 # i18n: "bumped" is a keyword
441 getargs(x, 0, 0, _("bumped takes no arguments")) 441 getargs(x, 0, 0, _("bumped takes no arguments"))
442 bumped = obsmod.getrevs(repo, 'bumped') 442 bumped = obsmod.getrevs(repo, 'bumped')
443 return [r for r in subset if r in bumped] 443 return [r for r in subset if r in bumped]
444 444
445 def bundle(repo, subset, x):
446 """``bundle()``
447 Changesets in the bundle.
448
449 Bundle must be specified by the -R option."""
450
451 try:
452 bundlenodes = repo.changelog.bundlenodes
453 except AttributeError:
454 raise util.Abort(_("no bundle provided - specify with -R"))
455 revs = set(repo[n].rev() for n in bundlenodes)
456 return [r for r in subset if r in revs]
457
445 def checkstatus(repo, subset, pat, field): 458 def checkstatus(repo, subset, pat, field):
446 m = None 459 m = None
447 s = [] 460 s = []
448 hasset = matchmod.patkind(pat) == 'set' 461 hasset = matchmod.patkind(pat) == 'set'
449 fname = None 462 fname = None
1511 "bisected": bisected, 1524 "bisected": bisected,
1512 "bookmark": bookmark, 1525 "bookmark": bookmark,
1513 "branch": branch, 1526 "branch": branch,
1514 "branchpoint": branchpoint, 1527 "branchpoint": branchpoint,
1515 "bumped": bumped, 1528 "bumped": bumped,
1529 "bundle": bundle,
1516 "children": children, 1530 "children": children,
1517 "closed": closed, 1531 "closed": closed,
1518 "contains": contains, 1532 "contains": contains,
1519 "converted": converted, 1533 "converted": converted,
1520 "date": date, 1534 "date": date,