Bug 3364 - largefiles: hg addremove fails for already removed largefile
Summary: largefiles: hg addremove fails for already removed largefile
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: largefiles (show other bugs)
Version: unspecified
Hardware: All All
: normal bug
Assignee: Bugzilla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-10 12:07 UTC by Matthew Giannini
Modified: 2012-09-30 16:19 UTC (History)
9 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 Matthew Giannini 2012-04-10 12:07 UTC
If you remove a large file using standard OS tool (e.g. rm, del) and then do 
an hg addremove you could the error below. In this example, setup.exe is a 
largefile.

D:\repo> del setup.exe

D:\repo> hg status
! setup.exe

D:\repo> hg addremove
setup.exe: The system cannot find the path specified
Comment 1 Matthew Giannini 2012-04-26 09:05 UTC
*bump* - can anyone reproduce or confirm this bug?
Comment 2 Na'Tosha Bard 2012-04-26 09:10 UTC
I cannot reproduce it using Mercurial 2.1.1 -- what version of Mercurial do 
you have?
Comment 3 Matthew Giannini 2012-04-26 12:11 UTC
I just reproduced it again using Mercurial 2.1.2

D:\temp\large\x64-win-jre\jdk6\bin>del xjc.exe

D:\temp\large\x64-win-jre\jdk6\bin>hg status
! jdk6\bin\xjc.exe

D:\temp\large\x64-win-jre\jdk6\bin>hg addremove
jdk6\bin\xjc.exe: The system cannot find the path specified

Don't know if this would make a difference or not but we are using the 
projrc extension on a per-repository basis as the means to enable largefiles 
instead of turning it on globally.
Comment 4 Greg Ward 2012-04-30 18:56 UTC
@mgiannini: Please run your "hg addremove" command with --debug and
--traceback. That might shed a little light.
Comment 5 Matthew Giannini 2012-05-07 07:37 UTC
D:\temp\env\x64-win-jre\jdk6\bin>hg addremove --debug --traceback
jdk6\bin\xjc.exe: The system cannot find the path specified
Traceback (most recent call last):
  File "mercurial\dispatch.pyo", line 87, in _runcatch
  File "mercurial\dispatch.pyo", line 685, in _dispatch
  File "mercurial\dispatch.pyo", line 467, in runcommand
  File "mercurial\dispatch.pyo", line 739, in _runcommand
  File "mercurial\dispatch.pyo", line 693, in checkargs
  File "mercurial\dispatch.pyo", line 682, in <lambda>
  File "mercurial\util.pyo", line 456, in check
  File "mercurial\extensions.pyo", line 139, in wrap
  File "mercurial\util.pyo", line 456, in check
  File "hgext\largefiles\overrides.pyo", line 911, in override_addremove
  File "hgext\largefiles\overrides.pyo", line 59, in add_largefiles
  File "hgext\largefiles\lfutil.pyo", line 72, in getminsize
Abort: minimum size for largefiles must be specified
abort: minimum size for largefiles must be specified


Apologies for the late response. I was out-of-office for a while.
Comment 6 Bugzilla 2012-05-12 09:29 UTC

--- Bug imported by bugzilla@serpentine.com 2012-05-12 09:29 EDT  ---

This bug was previously known as _bug_ 3363 at http://mercurial.selenic.com/bts/issue3363
Comment 7 Michal Sznajder 2012-06-07 08:02 UTC
I am able to reproduce this on latest release with different error messages.

### some enviroment info
D:\temp\large_file_repo>hg debugconfig | findstr /c:large
bundle.mainreporoot=D:\temp\large_file_repo
extensions.largefiles=
largefiles.minsize=10
largefiles.patterns=\n**.chm\n**.CHM\n**.chw\n**.CHW\n**.dll\n**.DLL\n**.dll.Test\n**.doc\n**.DOC\n**.e32\n**.E32\n**.eap\n**.EAP\n**.e
xe\n**.EXE\n**.jar\n**.JAR\n**.lib\n**.LIB\n**.mdb\n**.MDB\n**.ocx\n**.OCX\n**.pdb\n**.PDB\n**.ppt\n**.PPT\n**.tlb\n**.TLB\n**.vsd\n**.
VSD\n**.xls\n**.XLS\n**.zip\n**.ZIP

D:\temp\large_file_repo>hg --version
Mercurial Distributed SCM (version 2.2.1)
(see http://mercurial.selenic.com for more information)

Copyright (C) 2005-2012 Matt Mackall and others
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

### create test repo with 2 files
D:\temp>hg init large_file_repo

D:\temp>cd large_file_repo

D:\temp\large_file_repo>mkdir subrepo

D:\temp\large_file_repo>echo > normal

D:\temp\large_file_repo>echo > large

D:\temp\large_file_repo>hg add normal

D:\temp\large_file_repo>hg add --large large

D:\temp\large_file_repo>hg commit -m "added"

D:\temp\large_file_repo>hg addremove
removing large

### NOK: no changes detected
D:\temp\large_file_repo>hg --traceback --debug --verbose commit -m removed
nothing changed

### let's remove one normal file
D:\temp\large_file_repo>del normal

D:\temp\large_file_repo>hg addremove
removing normal

### OK: full commit works as expected
D:\temp\large_file_repo>hg --traceback --debug --verbose commit -m "removed"
calling hook commit.lfiles: <function checkrequireslfiles at 0x01727CB0>
committed changeset 1:ae75a3688dcf9997fe83255723297df6243a4e4f

I run a ClearCase migration and we use hg addremove to detect changes in ClearCase sources. So with this bug my migration scripts get broken sometimes...
Comment 8 Na'Tosha Bard 2012-07-09 07:29 UTC
(In reply to comment #7)

Assuming you meant to have a step in your test case that did "rm large" (as it is, you go straight from 'hg commit' to 'hg addremove' and 'large' is removed; I assume you left this step out), I have just tried to reproduce this on default changeset 2e13c1bd34dc and was unable to do so.

I think some changes have been made for addremove since 2.1.X, can you please try again?  If you can reproduce it, please attach a simple shell script that I can run to reproduce the error.
Comment 9 chris_wachter 2012-07-13 19:34 UTC
Here is an example (linux/bash) showing hg's refusal to commit after removal:

$ mkdir test; cd test
$ hg version | head -n 1
Mercurial Distributed SCM (version 2.2.2)

$ hg init
$ touch foo
$ hg add --large foo
$ hg ci -m 'test'
$ rm foo
$ hg stat
! foo

$ hg ci -m 'will not check in'
nothing changed

$ hg id
a248e7ca8d46 tip

$ hg stat
! foo

$ hg addremove
removing foo

$ hg ci -m 'still will not check in'
nothing changed

$ hg id
a248e7ca8d46 tip
Comment 10 Matt Harbison 2012-07-20 17:49 UTC
Patch submitted here:

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