comparison mercurial/bundlerepo.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 1d710fe5ee0e
children a39fe76c4c65
comparison
equal deleted inserted replaced
17908:42f8ee0e04ac 17913:03e552aaae67
31 revlog.revlog.__init__(self, opener, indexfile) 31 revlog.revlog.__init__(self, opener, indexfile)
32 self.bundle = bundle 32 self.bundle = bundle
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:
39 break 40 break
40 node = chunkdata['node'] 41 node = chunkdata['node']
46 47
47 size = len(delta) 48 size = len(delta)
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
54 continue 56 continue
55 57