Ticket #161 (new defect)

Opened 5 years ago

Last modified 5 years ago

git target fails on rename

Reported by: jhs Owned by: lele
Priority: major Milestone: VersionOne
Component: git Version: 0.9
Keywords: rename Cc:

Description

The git target is throwing an exception when converting a small project from bzr. I believe the problem situation is during a rename in a changeset. The current git implementation seems to assume that the file has already been renamed, so it just runs a "git add", however, in disjunct operation, the file has not been renamed yet and so "git mv" is needed.

As an example, you can try to run tailor on my attached Strangle-bzr2git.py config file. (Although it goes much faster if you bzr branch my code first and then reconfigure it to use the local copy.) Notice that

Attachments

tailor_git_target_disjunct_rename.patch Download (2.1 KB) - added by jhs 5 years ago.
Patch that fixes the problem, at least in my case.
Strangle-bzr2git.conf Download (320 bytes) - added by jhs 5 years ago.
Example Tailor config file

Change History

Changed 5 years ago by jhs

Patch that fixes the problem, at least in my case.

Changed 5 years ago by jhs

Example Tailor config file

comment:1 Changed 5 years ago by jhs

Whoops, I submitted too soon.

The attached file is Strangle-bzr2git.conf. Notice that for changeset 73, tailor dies with an exception saying (in my case):

14:22:38 [I] /home/jhs/src/Strangle-git/Strangle.git $ git add Strangle
14:22:38 [W] [Status 128]
14:22:38 [E] Failure replaying: Revision: jhs@proven-corporation.com-20080124065450-2f15i74u6u2afi8y
Date: 2008-01-24 13:54:50.723000+07:00
Author: Jason Smith <jhs@proven-corporation.com>
Entries: Strangle[DIR](REN from Constrict), test/testStrangle.py(REN from test/testConstrict.py), README(UPD), Strangle/__init__.py(UPD), Strangle/libbind.c(UPD), setup.py(UPD), test/allTests.py(UPD), test/print.py(UPD), test/testlibbind.py(UPD), test/testlibbind_ns_msg.py(UPD), test/testlibbind_ns_rr.py(UPD), test/testutils.py(UPD)
Log: Rename all "Constrict" to "Strangle"
Traceback (most recent call last):
  File "/home/jhs/src/tailor/run/lib/python2.5/site-packages/tailor-0.9.35-py2.5.egg/vcpx/target.py", line 134, in replayChangeset
    self._replayChangeset(changeset)
  File "/home/jhs/src/tailor/run/lib/python2.5/site-packages/tailor-0.9.35-py2.5.egg/vcpx/target.py", line 330, in _replayChangeset
    action(group)
  File "/home/jhs/src/tailor/run/lib/python2.5/site-packages/tailor-0.9.35-py2.5.egg/vcpx/target.py", line 502, in _renameEntries
    self._renamePathname(e.old_name, e.name)
  File "/home/jhs/src/tailor/run/lib/python2.5/site-packages/tailor-0.9.35-py2.5.egg/vcpx/repository/git/target.py", line 259, in _renamePathname
    self.repository.runCommand(['add', newname])
  File "/home/jhs/src/tailor/run/lib/python2.5/site-packages/tailor-0.9.35-py2.5.egg/vcpx/repository/git/__init__.py", line 77, in runCommand
    raise exception(str(c) + ' failed')
Exception: /home/jhs/src/Strangle-git/Strangle.git $ git add Strangle failed
14:22:38 [C] Couldn't replay changeset:

Finally, the attached patch did get my conversion to work; however I am unfamiliar with the Tailor API and architecture, so I am not certain whether this is the correct solution.

Thanks.

comment:2 Changed 5 years ago by lele

I could not try it, but I applied the patch as [1651], thank you.

Note: See TracTickets for help on using tickets.