Incorrect trunk branch detected

Create issue
Issue #201 open
NicolasL created an issue

In my use case I had to move a trunk folder into its subfolder. I didn't want to loose svn properties in the trunk folder, so here is what I did on my svn: {{{ svn mv trunk mysubfolder svn ci svn mkdir trunk svn ci svn mv mysubfolder trunk/ svn ci }}}

On the first commit, hgsubversion detects the close of the "default" branch and the creation of the "../mysubfolder". ok On the second commit, there is no correspondong hg commit. why not. On the third commit, hg detets the creation of the branch "../trunk/mysubfolder" which is incorrect.

With the attached patch, the last commit is correctly detected has being in the "default" branch.

Comments (6)

  1. Dan Villiom Podlaski Christiansen

    I tried to look into this, but I couldn't figure out how to fix it. I've attached a patch that contains an attempted fix — similar to yours, in fact — as well as tests for this. However, the fix isn't sufficient, and the test fails like this:

    ======================================================================
    FAIL: test_trunk_to_branch_to_trunk_subdir (test_fetch_branches.TestFetchBranches)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/Users/danchr/src/opensrc/vcs/hgsubversion/tests/test_fetch_branches.py", line 162, in test_trunk_to_branch_to_trunk_subdir
        self.assertEqual(set(repo['default']), set(['subdir/A', 'subdir/B']))
    AssertionError: set(['A', 'subdir/A', 'B', 'subdir/B']) != set(['subdir/B', 'subdir/A'])
    

    In other words, the files in the branch are duplicated to both the subdirectory and the trunk directory.

  2. NicolasL reporter

    I tried with making the commit which create the trunk on the svn part, have sort of the same on the hg part. On hg part it will "reopen" the default branch, but also clean it for every files in there.

    As I don't know the hg api, the patch I provide compute incorrectly the list of files to delete. It works though with the provided simple test. I don't know how to launch unit test so I didn't check them.

    I did some change in editor.py in the add_directory function. I don't understand why br_path should be not None to have an empty branch, so I changed it, but quite blindly due to my non understanding.

    I hope this helps.

  3. Log in to comment