[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mercurial-devel
Subject:    [issue750] Revisions with case-only renames cannot be checkout on
From:       Patrick_Mézard <mercurial-bugs () selenic ! com>
Date:       2007-09-23 19:21:12
Message-ID: 1190575272.79.0.461139286286.issue750 () selenic ! com
[Download RAW message or body]

New submission from Patrick Mézard <pmezard@gmail.com>:

Posted by Andrei Vermel, with suggested patch attached:

C:\temp\aaa>hg version
Mercurial Distributed SCM (version 81575b7b505e)

Copyright (C) 2005-2007 Matt Mackall <mpm@selenic.com> 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.

C:\temp\aaa>hg init
C:\temp\aaa>echo aaa >aaa.txt
C:\temp\aaa>hg add
adding aaa.txt
C:\temp\aaa>hg ci -m 1
C:\temp\aaa>hg ren aaa.txt qqq
C:\temp\aaa>hg ren qqq AAA.TXT
C:\temp\aaa>hg ci -m 2
C:\temp\aaa>hg update -C 0
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
C:\temp\aaa>hg --traceback update -C 1
Traceback (most recent call last):
  File "C:\Python24\Lib\site-packages\mercurial\dispatch.py", line 45, in _runcatch
    return _dispatch(ui, args)
  File "C:\Python24\Lib\site-packages\mercurial\dispatch.py", line 348, in _dispatch
    ret = _runcommand(ui, options, cmd, d)
  File "C:\Python24\Lib\site-packages\mercurial\dispatch.py", line 401, in
_runcommand
    return checkargs()
  File "C:\Python24\Lib\site-packages\mercurial\dispatch.py", line 357, in checkargs
    return cmdfunc()
  File "C:\Python24\Lib\site-packages\mercurial\dispatch.py", line 340, in <lambda>
    d = lambda: func(ui, repo, *args, **cmdoptions)
  File "C:\Python24\Lib\site-packages\mercurial\commands.py", line 2713, in update
    return hg.clean(repo, rev)
  File "C:\Python24\Lib\site-packages\mercurial\hg.py", line 273, in clean
    stats = _merge.update(repo, node, False, True, None)
  File "C:\Python24\Lib\site-packages\mercurial\merge.py", line 628, in update
    recordupdates(repo, action, branchmerge)
  File "C:\Python24\Lib\site-packages\mercurial\merge.py", line 526, in
recordupdates
    repo.dirstate.normal(f)
  File "C:\Python24\Lib\site-packages\mercurial\dirstate.py", line 221, in normal
    s = os.lstat(self._join(f))
OSError: [Errno 2] No such file or directory: 'C:\\temp\\aaa\\AAA.TXT'
abort: No such file or directory: C:\temp\aaa\AAA.TXT

----------
files: update.patch
messages: 4034
nosy: pmezard
priority: bug
status: unread
title: Revisions with case-only renames cannot be checkout on case-aware systems

____________________________________________________
Mercurial issue tracker <mercurial-bugs@selenic.com>
<http://www.selenic.com/mercurial/bts/issue750>
____________________________________________________
["update.patch" (text/x-patch)]

# HG changeset patch
# User Andrei Vermel <avermel@mail.ru>
# Date 1190098471 -14400
# Node ID b23e1acd1948cd28b55c359aae995ae7f794c616
# Parent  360873d1a8fb9ab6b3110b3d31e5e9fa8d35f9b0
Make update remove files before get to fix casefolding problem

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -434,11 +434,14 @@ def manifestmerge(repo, p1, p2, pa, over
 
     return action
 
+def cmp_actions(x, y):
+    return y[1].__lt__(x[1])    
+
 def applyupdates(repo, action, wctx, mctx):
     "apply the merge action list to the working directory"
 
     updated, merged, removed, unresolved = 0, 0, 0, 0
-    action.sort()
+    action.sort(cmp_actions)
     # prescan for copy/renames
     for a in action:
         f, m = a[:2]


_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@selenic.com
http://selenic.com/mailman/listinfo/mercurial-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic