##// END OF EJS Templates
bundle: add revset expression to show bundle contents (issue3487)...
Tomasz Kleczek -
r17913:03e552aa default
parent child Browse files
Show More
@@ -33,6 +33,7 b' class bundlerevlog(revlog.revlog):'
33 self.basemap = {}
33 self.basemap = {}
34 n = len(self)
34 n = len(self)
35 chain = None
35 chain = None
36 self.bundlenodes = []
36 while True:
37 while True:
37 chunkdata = bundle.deltachunk(chain)
38 chunkdata = bundle.deltachunk(chain)
38 if not chunkdata:
39 if not chunkdata:
@@ -48,6 +49,7 b' class bundlerevlog(revlog.revlog):'
48 start = bundle.tell() - size
49 start = bundle.tell() - size
49
50
50 link = linkmapper(cs)
51 link = linkmapper(cs)
52 self.bundlenodes.append(node)
51 if node in self.nodemap:
53 if node in self.nodemap:
52 # this can happen if two branches make the same change
54 # this can happen if two branches make the same change
53 chain = node
55 chain = node
@@ -442,6 +442,19 b' def bumped(repo, subset, x):'
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 = []
@@ -1513,6 +1526,7 b' symbols = {'
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,
@@ -444,6 +444,33 b' Unbundle incremental bundles into fresh '
444 added 1 changesets with 1 changes to 1 files
444 added 1 changesets with 1 changes to 1 files
445 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
445 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
446
446
447 View full contents of the bundle
448 $ hg -R test bundle --base null -r 3 ../partial.hg
449 4 changesets found
450 $ cd test
451 $ hg -R ../../partial.hg log -r "bundle()"
452 changeset: 0:f9ee2f85a263
453 user: test
454 date: Thu Jan 01 00:00:00 1970 +0000
455 summary: 0.0
456
457 changeset: 1:34c2bf6b0626
458 user: test
459 date: Thu Jan 01 00:00:00 1970 +0000
460 summary: 0.1
461
462 changeset: 2:e38ba6f5b7e0
463 user: test
464 date: Thu Jan 01 00:00:00 1970 +0000
465 summary: 0.2
466
467 changeset: 3:eebf5a27f8ca
468 user: test
469 date: Thu Jan 01 00:00:00 1970 +0000
470 summary: 0.3
471
472 $ cd ..
473
447 test for 540d1059c802
474 test for 540d1059c802
448
475
449 test for 540d1059c802
476 test for 540d1059c802
General Comments 0
You need to be logged in to leave comments. Login now