##// END OF EJS Templates
mq: qpop should act like quilt pop...
Chris Mason -
r2697:6c540dd1 default
parent child Browse files
Show More
@@ -708,7 +708,8 b' class queue:'
708 self.ui.write("Now at: %s\n" % top)
708 self.ui.write("Now at: %s\n" % top)
709 return ret[0]
709 return ret[0]
710
710
711 def pop(self, repo, patch=None, force=False, update=True, wlock=None):
711 def pop(self, repo, patch=None, force=False, update=True, all=False,
712 wlock=None):
712 def getfile(f, rev):
713 def getfile(f, rev):
713 t = repo.file(f).read(rev)
714 t = repo.file(f).read(rev)
714 try:
715 try:
@@ -749,7 +750,17 b' class queue:'
749 self.applied_dirty = 1;
750 self.applied_dirty = 1;
750 end = len(self.applied)
751 end = len(self.applied)
751 if not patch:
752 if not patch:
752 info = [len(self.applied) - 1] + self.applied[-1].split(':')
753 if all:
754 popi = 0
755 else:
756 popi = len(self.applied) - 1
757 else:
758 popi = info[0] + 1
759 if popi >= end:
760 self.ui.warn("qpop: %s is already at the top\n" % patch)
761 return
762 info = [ popi ] + self.applied[popi].split(':')
763
753 start = info[0]
764 start = info[0]
754 rev = revlog.bin(info[1])
765 rev = revlog.bin(info[1])
755
766
@@ -1276,9 +1287,7 b' def pop(ui, repo, patch=None, **opts):'
1276 localupdate = False
1287 localupdate = False
1277 else:
1288 else:
1278 q = repomap[repo]
1289 q = repomap[repo]
1279 if opts['all'] and len(q.applied) > 0:
1290 q.pop(repo, patch, force=opts['force'], update=localupdate, all=opts['all'])
1280 patch = q.applied[0].split(':')[1]
1281 q.pop(repo, patch, force=opts['force'], update=localupdate)
1282 q.save_dirty()
1291 q.save_dirty()
1283 return 0
1292 return 0
1284
1293
General Comments 0
You need to be logged in to leave comments. Login now