handle directory creation in push

Create issue
Issue #26 resolved
Kumar McMillan created an issue

this is similar to http://www.bitbucket.org/durin42/hgsubversion/issue/5/handle-directory-deletes-in-push but a little different.

If you create a new directory, hg does not acknowledge it, for example:

$ mkdir site-packages $ hg stat


$ echo "foo" > site-packages/foo.txt $ hg st ? site-packages/foo.txt

when pushing foo.txt via svn push, the svn server complains because site-packages dir has not been created. I got:

Traceback (most recent call last): File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/bin/hg", line 20, in <module> mercurial.dispatch.run() File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5//lib/python2.5/site-packages/mercurial/dispatch.py", line 20, in run sys.exit(dispatch(sys.argv[1:])) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5//lib/python2.5/site-packages/mercurial/dispatch.py", line 29, in dispatch return _runcatch(u, args) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5//lib/python2.5/site-packages/mercurial/dispatch.py", line 45, in _runcatch return _dispatch(ui, args) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5//lib/python2.5/site-packages/mercurial/dispatch.py", line 367, in _dispatch ret = _runcommand(ui, options, cmd, d) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5//lib/python2.5/site-packages/mercurial/dispatch.py", line 420, in _runcommand return checkargs() File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5//lib/python2.5/site-packages/mercurial/dispatch.py", line 376, in checkargs return cmdfunc() File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5//lib/python2.5/site-packages/mercurial/dispatch.py", line 359, in <lambda> d = lambda: func(ui, repo, args, cmdoptions) File "/Users/kumar/src/hgsubversion/init.py", line 10, in svn return svncommand.svncmd(ui, repo, subcommand, *args, opts) File "/Users/kumar/src/hgsubversion/svncommand.py", line 39, in svncmd *opts) File "/Users/kumar/src/hgsubversion/push_cmd.py", line 44, in push_revisions_to_subversion commit_from_rev(ui, repo, old_ctx, hge, svn_url, base_revision) File "/Users/kumar/src/hgsubversion/push_cmd.py", line 139, in commit_from_rev base_revision, set(added_dirs), props) File "/Users/kumar/src/hgsubversion/svnwrap/svn_swig_wrapper.py", line 327, in commit self.pool) File "/opt/local/lib/svn-python/libsvn/delta.py", line 495, in svn_delta_path_driver File "/Users/kumar/src/hgsubversion/svnwrap/svn_swig_wrapper.py", line 321, in driver_cb wh_baton, pool) File "/opt/local/lib/svn-python/libsvn/delta.py", line 274, in svn_txdelta_send_txstream svn.core.SubversionException: ("Path 'trunk/site-packages' not present", 160016)

workaround is to manually create the dir in a raw svn commit then re-push. However, when there are many sub directories to create manually this becomes unrealistic.

Thus, this is a showstopper bug. I had to backout the changeset from hg and redo it as a raw svn commit.

Comments (2)

  1. Augie Fackler repo owner

    This should be working, I even have tests for the case. Can you get me some actual steps to reproduce?

  2. Augie Fackler repo owner

    Ah, I found a case that wasn't handled (assume trunk exists):

    mkdir -p foo/bar
    touch foo/bar/baz
    hg addr
    hg ci -m 'blah'
    hg svn push

    Would fail thus. Fixed in b33940d54fe2 .

  3. Log in to comment