Bug 3093 - Cannot rename a largefile
Summary: Cannot rename a largefile
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: unspecified
Hardware: All All
: normal bug
Assignee: Na'Tosha Bard
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-08 17:01 UTC by Olivier Groulx
Modified: 2011-12-01 16:00 UTC (History)
8 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 Olivier Groulx 2011-11-08 17:01 UTC
Renaming a large file confuse mercurial and render the repository unusable.

Step to reproduce :

hg init
hg add --large video.avi
hg status
   A video.avi
hg commit -m"added video"
hg rename video.avi movie.avi
hg status
   R C:\Users\Olivier\Desktop\testrepo\video.avi
   ! C:\Users\Olivier\Desktop\testrepo\movie.avi
   ! video.avi
   ? movie.avi
hg add
   abort: The system cannot find the file specified: 
C:\Users\Olivier\Desktop\testrepo\.hglf/video.avi
hg add movie.avi
  movie.avi already a largefile


Workaround :
None.
Comment 1 Matt Mackall 2011-11-10 14:28 UTC
Adding some largefiles people, setting recommended priority.
Comment 2 Na'Tosha Bard 2011-11-11 08:02 UTC
I reproduced this locally and am now working on a fix.  Thanks for the
proper failing test case.
Comment 3 Na'Tosha Bard 2011-11-18 10:48 UTC
Just an update; I have found the cause of this bug and it is a bit more
complicated than I anticipated.  I have a partial fix; will work more on it
next week.  Goal is to have this fix in next week before the 2.1 cut on
December 1st.
Comment 4 Na'Tosha Bard 2011-11-29 09:29 UTC
This case actually turned out not to be an issue with renaming itself, but
to be an issue with a messy dirstate causing very confusing status output
after running 'hg rename' (or 'hg copy', for that matter) on a largefile. 
If the user comitted a rename (or copy), despite the confusing output of
status, expected behavior occurred.  I have submitted a patch that fixes the
messy dirstate so that the output of 'hg status' is correct.  It also
introduces test cases to prevent regressions.

I will mark this as testing until the patch is queued.
Comment 5 Na'Tosha Bard 2011-11-29 09:41 UTC
Oops, marking this as "in-progress" instead.

Here is the thread on the mailing list with the patch:

http://www.selenic.com/pipermail/mercurial-devel/2011-November/036017.html
Comment 6 HG Bot 2011-12-01 16:00 UTC
Fixed by http://selenic.com/repo/hg/rev/a77ce45584ef
Na'Tosha Bard <natosha@unity3d.com>
largefiles: fix rename (issue3093)

(please test the fix)
Comment 7 Bugzilla 2012-05-12 09:25 UTC

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

This bug was previously known as _bug_ 3093 at http://mercurial.selenic.com/bts/issue3093