Bug 478841

Summary: Tailor Mercurial repository cannot delete files after mercurial 1.1 upgrade
Product: [Fedora] Fedora Reporter: Daniel Berrangé <berrange>
Component: tailorAssignee: Dan Horák <dan>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 9CC: dan
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-01-21 21:36:22 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Fix deleted file handling for mercurial 1.1.2 API
none
reverted patch none

Description Daniel Berrangé 2009-01-05 15:27:47 UTC
Following on from the original Mercurial 1.1 upgrade bug report (see bug #477148) , I've discovered a further problem in the HG plugin for tailor. With mercurial 1.1, it is no longer able to handle files which are deleted from the source repository, failing with the following stack trace



14:43:42 [C] Couldn't replay changeset: walk() takes exactly 4 arguments (2 given)
14:43:42 [C] Upstream change application failed
14:43:42 [C] Something unexpected!
Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/vcpx/tailor.py", line 154, in __call__
    self.update()
  File "/usr/lib/python2.5/site-packages/vcpx/tailor.py", line 118, in update
    applyable=self._applyable, applied=self._applied)
  File "/usr/lib/python2.5/site-packages/vcpx/dualwd.py", line 102, in applyPendingChangesets
    applied=applied)
  File "/usr/lib/python2.5/site-packages/vcpx/source.py", line 137, in applyPendingChangesets
    replay(c)
  File "/usr/lib/python2.5/site-packages/vcpx/dualwd.py", line 113, in replayChangeset
    self.target.replayChangeset(changeset)
  File "/usr/lib/python2.5/site-packages/vcpx/target.py", line 134, in replayChangeset
    self._replayChangeset(changeset)
  File "/usr/lib/python2.5/site-packages/vcpx/target.py", line 336, in _replayChangeset
    action(group)
  File "/usr/lib/python2.5/site-packages/vcpx/target.py", line 416, in _removeEntries
    self._removePathnames([e.name for e in entries])
  File "/usr/lib/python2.5/site-packages/vcpx/repository/hg.py", line 386, in _removePathnames
    files = self._walk(name)
  File "/usr/lib/python2.5/site-packages/vcpx/repository/hg.py", line 483, in _walk
    for src, path in self._getRepo().dirstate.walk(["qemud"]):
TypeError: walk() takes exactly 4 arguments (2 given)

Comment 1 Daniel Berrangé 2009-01-05 15:32:37 UTC
Created attachment 328203 [details]
Fix deleted file handling for mercurial 1.1.2 API

The syntax of the 'walk' method in mercurial.dirstate changed significantly

In 1.0.2:

-    def walk(self, files=None, match=util.always, badmatch=None):

In 1.1.2:

+    def walk(self, match, unknown, ignored):

The patch I'm uploading is my best guess at what the new API wants, and allowed me to continue to convert the libvirt CVS repo to Mercurial. 

It does not attempt to auto-detect which version of mercurial its running against, so it will need more work before it is suitable for tailor upstream. It would be OK for Fedora, assuming we add a 'Requires: mercurial >= 1.1.2' after applying it to RPM

Comment 2 Fedora Update System 2009-01-06 09:39:18 UTC
tailor-0.9.35-4.fc9 has been submitted as an update for Fedora 9.
http://admin.fedoraproject.org/updates/tailor-0.9.35-4.fc9

Comment 3 Fedora Update System 2009-01-06 09:40:09 UTC
tailor-0.9.35-4.fc10 has been submitted as an update for Fedora 10.
http://admin.fedoraproject.org/updates/tailor-0.9.35-4.fc10

Comment 4 Fedora Update System 2009-01-07 09:19:41 UTC
tailor-0.9.35-4.fc10 has been pushed to the Fedora 10 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update tailor'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F10/FEDORA-2009-0117

Comment 5 Fedora Update System 2009-01-07 09:19:58 UTC
tailor-0.9.35-4.fc9 has been pushed to the Fedora 9 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing-newkey update tailor'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F9/FEDORA-2009-0118

Comment 6 Dan Horák 2009-01-07 17:32:07 UTC
Created attachment 328401 [details]
reverted patch

Comment 7 Fedora Update System 2009-01-21 21:36:19 UTC
tailor-0.9.35-4.fc10 has been pushed to the Fedora 10 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 8 Fedora Update System 2009-01-21 21:37:40 UTC
tailor-0.9.35-4.fc9 has been pushed to the Fedora 9 stable repository.  If problems still persist, please make note of it in this bug report.