changeset 3980:e9460fe2f548

mq: use contexts
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Tue, 26 Dec 2006 03:29:00 +0100
parents e0d13267f7a4
children 180670f14045
files hgext/mq.py
diffstat 1 files changed, 8 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/mq.py	Tue Dec 26 03:27:24 2006 +0100
+++ b/hgext/mq.py	Tue Dec 26 03:29:00 2006 +0100
@@ -326,11 +326,12 @@
         hg.clean(repo, head, wlock=wlock)
         self.strip(repo, n, update=False, backup='strip', wlock=wlock)
 
-        c = repo.changelog.read(rev)
+        ctx = repo.changectx(rev)
         ret = hg.merge(repo, rev, wlock=wlock)
         if ret:
             raise util.Abort(_("update returned %d") % ret)
-        n = repo.commit(None, c[4], c[1], force=1, wlock=wlock)
+        n = repo.commit(None, ctx.description(), ctx.user(),
+                        force=1, wlock=wlock)
         if n == None:
             raise util.Abort(_("repo commit failed"))
         try:
@@ -612,15 +613,12 @@
             self.ui.warn("saving bundle to %s\n" % name)
             return changegroup.writebundle(cg, name, "HG10BZ")
 
-        def stripall(rev, revnum):
-            cl = repo.changelog
-            c = cl.read(rev)
-            mm = repo.manifest.read(c[0])
+        def stripall(revnum):
+            mm = repo.changectx(rev).manifest()
             seen = {}
 
-            for x in xrange(revnum, cl.count()):
-                c = cl.read(cl.node(x))
-                for f in c[3]:
+            for x in xrange(revnum, repo.changelog.count()):
+                for f in repo.changectx(x).files():
                     if f in seen:
                         continue
                     seen[f] = 1
@@ -702,7 +700,7 @@
             chgrpfile = bundle(backupch)
             chgrpfile = 'file:%s' % chgrpfile
 
-        stripall(rev, revnum)
+        stripall(revnum)
 
         change = chlog.read(rev)
         chlog.strip(revnum, revnum)