Bug 3507 - hg addremove fails for largefiles repo after "hg remove"
Summary: hg addremove fails for largefiles repo after "hg remove"
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: largefiles (show other bugs)
Version: earlier
Hardware: All All
: normal bug
Assignee: Bugzilla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-20 16:22 UTC by Eli
Modified: 2017-11-01 18:05 UTC (History)
5 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eli 2012-06-20 16:22 UTC
If you use "hg remove" to remove a file from a largefiles repository and then run "hg addremove", you get the following error:

abort: No such file or directory: /private/tmp/hgtest/hgtest/normal

To reproduce:

hg init hgtest
cd hgtest
echo > normal
echo > large
hg add normal
hg add --large large
hg commit -m "added"
hg remove normal 
hg addremove

Traceback:
$hg addremove --debug --traceback
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/mercurial/dispatch.py", line 87, in _runcatch
    return _dispatch(req)
  File "/Library/Python/2.7/site-packages/mercurial/dispatch.py", line 685, in _dispatch
    cmdpats, cmdoptions)
  File "/Library/Python/2.7/site-packages/mercurial/dispatch.py", line 467, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/Library/Python/2.7/site-packages/mercurial/dispatch.py", line 739, in _runcommand
    return checkargs()
  File "/Library/Python/2.7/site-packages/mercurial/dispatch.py", line 693, in checkargs
    return cmdfunc()
  File "/Library/Python/2.7/site-packages/mercurial/dispatch.py", line 682, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File "/Library/Python/2.7/site-packages/mercurial/util.py", line 456, in check
    return func(*args, **kwargs)
  File "/Library/Python/2.7/site-packages/mercurial/extensions.py", line 139, in wrap
    util.checksignature(origfn), *args, **kwargs)
  File "/Library/Python/2.7/site-packages/mercurial/util.py", line 456, in check
    return func(*args, **kwargs)
  File "/Library/Python/2.7/site-packages/hgext/largefiles/overrides.py", line 911, in override_addremove
    add_largefiles(ui, repo, *pats, **opts)
  File "/Library/Python/2.7/site-packages/hgext/largefiles/overrides.py", line 86, in add_largefiles
    os.lstat(repo.wjoin(f)).st_size >= lfsize * 1024 * 1024)
OSError: [Errno 2] No such file or directory: '/private/tmp/hgtest/hgtest/normal'
abort: No such file or directory: /private/tmp/hgtest/hgtest/normal

Note: This bug is related to bug 3364 (largefiles: hg addremove fails for already removed largefile).  However, the error in 3364 is produced when files are removed via system (rm or del, rather than hg remove).
Comment 1 Matt Harbison 2012-07-20 17:46 UTC
Patch submitted here:

http://www.selenic.com/pipermail/mercurial-devel/2012-July/042933.html
Comment 2 Matt Harbison 2012-07-25 12:27 UTC
Fix here: http://selenic.com/hg/rev/2446b63c89ec
Comment 3 Matt Mackall 2012-09-30 16:19 UTC
Mass close old bugs in testing.