# HG changeset patch # User Patrick Mezard # Date 1288296273 -7200 # Node ID b59b5193d4d067383074b69c059cacb63b1aba55 # Parent bb7bf43b72fb6e3485588ac4c121ac3408068e8b mq: qrename should not touch the dirstate if src is untracked (issue2460) diff -r bb7bf43b72fb -r b59b5193d4d0 hgext/mq.py --- a/hgext/mq.py Thu Oct 28 21:25:53 2010 +0200 +++ b/hgext/mq.py Thu Oct 28 22:04:33 2010 +0200 @@ -2400,7 +2400,7 @@ os.makedirs(destdir) util.rename(q.join(patch), absdest) r = q.qrepo() - if r: + if r and patch in r.dirstate: wctx = r[None] wlock = r.wlock() try: diff -r bb7bf43b72fb -r b59b5193d4d0 tests/test-mq-qrename.t --- a/tests/test-mq-qrename.t Thu Oct 28 21:25:53 2010 +0200 +++ b/tests/test-mq-qrename.t Thu Oct 28 22:04:33 2010 +0200 @@ -81,3 +81,16 @@ A patchc R patcha $ cd .. + +Test renames with mq repo (issue2097) + + $ hg init issue2097 + $ cd issue2097 + $ hg qnew p0 + $ (cd .hg/patches && hg init) + $ hg qren p0 p1 + $ hg debugstate --mq + $ hg ci --mq -mq0 + nothing changed + [1] + $ cd ..