Migrate from GitHub to SourceForge with this tool. Check out all of SourceForge's recent improvements.
Close

#1545 Bug in File Rename

Branch_+_Trunk
closed-fixed
5
2007-09-15
2007-09-04
Anonymous
No

Files can be renamed via the GUI. However when renaming a File that is in the Right Only the Right File is renamed and the Left Parent Directory is Renamed

C:\Files1\ C:\Files2\NewFile.txt

RENAME to NewFile.doc

Dir is renamed File is renamed

C:\NewFile.doc C:\Files2\NewFile.doc

rex@kalos-inc.com

Discussion

  • Nobody/Anonymous

    Win Merge Lig

     
  • Kimmo Varis

    Kimmo Varis - 2007-09-04
    • assigned_to: nobody --> kimmov
    • status: open --> open-accepted
     
  • Kimmo Varis

    Kimmo Varis - 2007-09-04

    Logged In: YES
    user_id=631874
    Originator: NO

    Ok, I can see this too - investigating...

     
  • Kimmo Varis

    Kimmo Varis - 2007-09-04

    Logged In: YES
    user_id=631874
    Originator: NO

    Obvious bug - and once again in rename. :(

    There wasn't proper check for item's nature (both/left/right sides) before renaming and unlucky to us the path for non-existing side ended up being parent folder's path..

    The patch:
    Index: DirActions.cpp
    ===================================================================
    --- DirActions.cpp (revision 4508)
    +++ DirActions.cpp (working copy)
    @@ -1488,14 +1488,18 @@
    return FALSE;
    }

    - BOOL bRenameLeft = RenameOnSameDir(sLeftFile, szNewItemName);
    - BOOL bRenameRight = RenameOnSameDir(sRightFile, szNewItemName);
    -
    POSITION key = GetItemKey(nSelItem);
    ASSERT(key != SPECIAL_ITEM_POS);
    di = GetDocument()->GetDiffRefByKey(key);

    - if ((TRUE == bRenameLeft) && (TRUE == bRenameRight))
    + BOOL bRenameLeft = FALSE;
    + BOOL bRenameRight = FALSE;
    + if (di.diffcode.isSideLeftOrBoth())
    + bRenameLeft = RenameOnSameDir(sLeftFile, szNewItemName);
    + if (di.diffcode.isSideRightOrBoth())
    + bRenameRight = RenameOnSameDir(sRightFile, szNewItemName);
    +
    + if ((TRUE == bRenameLeft) && (TRUE == bRenameRight))
    {
    di.sLeftFilename = szNewItemName;
    di.sRightFilename = szNewItemName;

    File Added: Unique_item_rename_fix.patch

     
  • Kimmo Varis

    Kimmo Varis - 2007-09-04
    • milestone: --> Branch_+_Trunk
     
  • Kimmo Varis

    Kimmo Varis - 2007-09-05

    Logged In: YES
    user_id=631874
    Originator: NO

    Fix committed to SVN trunk.
    Completed: At revision: 4512

    Leaving open for 2.6 branch commit.

     
  • Kimmo Varis

    Kimmo Varis - 2007-09-05
    • status: open-accepted --> open-fixed
     
  • Kimmo Varis

    Kimmo Varis - 2007-09-13

    Logged In: YES
    user_id=631874
    Originator: NO

    Attaching a patch for 2.6 branch.

    File Added: Unique_item_rename_fix_26.patch

     
  • Kimmo Varis

    Kimmo Varis - 2007-09-15

    Logged In: YES
    user_id=631874
    Originator: NO

    Fix committed to 2.6 branch.
    Completed: At revision: 4543

     
  • Kimmo Varis

    Kimmo Varis - 2007-09-15
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.