Ticket Change Details
Not logged in
Overview

Artifact ID: c7e406f7d239d9b0fc49742c8bedaf0029670506
Ticket: 1d50540ec50335beef3ee228185392d694c3b66a
Merging branches with a renamed file
User & Date: anonymous 2011-02-07 18:31:16
Changes

  1. comment changed to:
    If you update to a branch and move a file to a directory that doesn't exist in the mainline tree, a merge will fail.
    
    In a new repository (in tcsh(1): <code>alias fs fossil</code>):
    
    <pre>echo "hello" > bar.txt
    fs add bar.txt
    fs ci -m "Creating a branch" --branch rename_bug bar.txt
    mkdir foo
    fs mv bar.txt foo/bar.txt
    mv bar.txt foo/bar.txt
    fs ci -m "Moved bar.txt to foo/"
    fs up master
    fs merge rename_bug</pre>
    
    The expected error output is:
    
    <pre>fossil: SQLITE_BUSY: statement aborts at 2: [ROLLBACK] cannot rollback transaction - SQL statements in progress</pre>
    
    If you pipe the merge to a file and don't capture stderr, you should be able to spot the problem:
    
    <pre>fossil: cannot open "/private/tmp/fs-merge-bug/foo/bar.txt" for writing</pre>
    
    I think it should be pretty easy to replicate the problem.
    
    I'm speculating, but it looks like the easiest fix is to update src/file.c:file_copy() to be updated to create the destination directory if it doesn't exist.  On the flip side, given the directory permissions, maybe it's better to just append an error message to the output when the command finishes rolling back the merge?  Food for though I suppose.
    
  2. foundin changed to: "d5729c31b5"
  3. private_contact changed to: "84f59114b7eee7088fd7e2932599c69c9ad0761b"
  4. severity changed to: "Minor"
  5. status changed to: "Open"
  6. title changed to: "Merging branches with a renamed file"
  7. type changed to: "Code_Defect"