Mercurial > hg
comparison contrib/shrink-revlog.py @ 14029:83d3f87c059e
shrink-revlog: update util.opener to scmutil.opener after d13913355390
author | Augie Fackler <durin42@gmail.com> |
---|---|
date | Fri, 29 Apr 2011 08:01:10 -0500 |
parents | 7e453770b364 |
children | e5dd974a99fa |
comparison
equal
deleted
inserted
replaced
14028:7e453770b364 | 14029:83d3f87c059e |
---|---|
15 # XXX would be nice to have a way to verify the repository after shrinking, | 15 # XXX would be nice to have a way to verify the repository after shrinking, |
16 # e.g. by comparing "before" and "after" states of random changesets | 16 # e.g. by comparing "before" and "after" states of random changesets |
17 # (maybe: export before, shrink, export after, diff). | 17 # (maybe: export before, shrink, export after, diff). |
18 | 18 |
19 import os, tempfile, errno | 19 import os, tempfile, errno |
20 from mercurial import revlog, transaction, node, util | 20 from mercurial import revlog, transaction, node, util, scmutil |
21 from mercurial import changegroup | 21 from mercurial import changegroup |
22 from mercurial.i18n import _ | 22 from mercurial.i18n import _ |
23 | 23 |
24 | 24 |
25 def postorder(start, edges): | 25 def postorder(start, edges): |
188 | 188 |
189 ui.write(_('shrinking %s\n') % indexfn) | 189 ui.write(_('shrinking %s\n') % indexfn) |
190 prefix = os.path.basename(indexfn)[:-1] | 190 prefix = os.path.basename(indexfn)[:-1] |
191 tmpindexfn = util.mktempcopy(indexfn, emptyok=True) | 191 tmpindexfn = util.mktempcopy(indexfn, emptyok=True) |
192 | 192 |
193 r1 = revlog.revlog(util.opener(os.getcwd(), audit=False), indexfn) | 193 r1 = revlog.revlog(scmutil.opener(os.getcwd(), audit=False), indexfn) |
194 r2 = revlog.revlog(util.opener(os.getcwd(), audit=False), tmpindexfn) | 194 r2 = revlog.revlog(scmutil.opener(os.getcwd(), audit=False), tmpindexfn) |
195 | 195 |
196 datafn, tmpdatafn = r1.datafile, r2.datafile | 196 datafn, tmpdatafn = r1.datafile, r2.datafile |
197 | 197 |
198 oldindexfn = indexfn + '.old' | 198 oldindexfn = indexfn + '.old' |
199 olddatafn = datafn + '.old' | 199 olddatafn = datafn + '.old' |