Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/cmdutil.py @ 11152:e8d10d085f47
cmdutil: Warn when trying to copy/rename --after to a nonexistant file.
Currently running 'hg rename --after foo.txt bar.typo' is a silent no-op. This patch adds a warning. It also updates the copy and rename tests.
No actual functionality is changed.
fixes issue 1822
author | Steve Losh <steve@stevelosh.com> |
---|---|
date | Sat, 01 May 2010 18:39:40 -0400 |
parents | 51d0387523c6 |
children | 6a64813276ed |
comparison
equal
deleted
inserted
replaced
11151:c5c190822501 | 11152:e8d10d085f47 |
---|---|
394 reltarget) | 394 reltarget) |
395 return | 395 return |
396 | 396 |
397 if after: | 397 if after: |
398 if not exists: | 398 if not exists: |
399 if rename: | |
400 ui.warn(_('%s: not recording move - %s does not exist\n') % | |
401 (relsrc, reltarget)) | |
402 else: | |
403 ui.warn(_('%s: not recording copy - %s does not exist\n') % | |
404 (relsrc, reltarget)) | |
399 return | 405 return |
400 elif not dryrun: | 406 elif not dryrun: |
401 try: | 407 try: |
402 if exists: | 408 if exists: |
403 os.unlink(target) | 409 os.unlink(target) |