comparison hgext/mq.py @ 13632:33a33f19aad2 stable

mq: do not let qrefresh write bad patch
author Martin Geisler <mg@lazybytes.net>
date Sun, 13 Mar 2011 16:18:46 +0100
parents 9510ddf87c43
children 4e976235c985 6783f47d90dd
comparison
equal deleted inserted replaced
13631:29c800ee54cf 13632:33a33f19aad2
1453 repo.dirstate.invalidate() 1453 repo.dirstate.invalidate()
1454 raise 1454 raise
1455 1455
1456 try: 1456 try:
1457 # might be nice to attempt to roll back strip after this 1457 # might be nice to attempt to roll back strip after this
1458 patchf.rename()
1459 n = repo.commit(message, user, ph.date, match=match, 1458 n = repo.commit(message, user, ph.date, match=match,
1460 force=True) 1459 force=True)
1460 # only write patch after a successful commit
1461 patchf.rename()
1461 self.applied.append(statusentry(n, patchfn)) 1462 self.applied.append(statusentry(n, patchfn))
1462 except: 1463 except:
1463 ctx = repo[cparents[0]] 1464 ctx = repo[cparents[0]]
1464 repo.dirstate.rebuild(ctx.node(), ctx.manifest()) 1465 repo.dirstate.rebuild(ctx.node(), ctx.manifest())
1465 self.save_dirty() 1466 self.save_dirty()