Re: PATCHES: start adding Mercurial backend (HgOutputOption)
Michael Haggerty <[email protected]> Tue, 29 Sep 2009 06:51:33 +0200
| Newsgroups | gmane.comp.version-control.subversion.cvs2svn.devel |
|---|---|
| Message-ID | <[email protected]> |
Greg Ward wrote: > [...] As before, here are the patches to add and test basic Mercurial > output. [...] Realistically, I'm not going to have the time to review your changes very thoroughly, let alone learn enough about Mercurial to verify that the 2hg part makes sense. I did skim through your patches and have a few basic comments: > def _commit_memctx(self, mctx): > # XXX should I be wrapping my txn in weakref.proxy()? > txn = self.repo.transaction() > try: > node = self.repo.commitctx(mctx) > txn.close() > finally: > del txn > return node I don't understand the point of the try...finally here. "del txn" does not force txn.__del__() to be run; it only unbinds the local "txn" variable (possibly allowing __del__() to run if the reference count goes to zero). But txn will be unbound anyway when the function returns on the next statement, so "del txn" doesn't accomplish anything. It would be more typical to see "txn.close()" in the finally part of this construct, though I have no idea whether that makes sense here. + # XXX it ought to be possible for a CVS tag to have a split beginning, just + # like a CVS branch can. Should handle it the same we way handle split + # branches. cvs2svn always assembles the creation of a CVS tag into a single commit. This is always possible because (1) the creation of a CVS tag is not timestamped, so there is no grounds to infer that the tag was created at multiple points in time, and (2) no other commits can depend on a CVSTag, so there are no cycle-breaking reasons to split up a tag commit. In practice, tag commits are created as soon as the last tagged CVSRevision has been committed. If cvs2svn would support incremental conversion, then of course files might be added to an existing tag between conversion N and N+1, and we would have to allow for tags being created in multiple steps. But incremental conversion support is not on the road map. > # Testing strategy for Mercurial conversion: the gold standard, of > # course, is to compare a CVS working copy with the hg working copy at > # various points in history. contrib/verify-cvs2svn.py can do this for > # a single repository that has already been converted; > # contrib/verify-all does it for a bunch of repos (by default, > # test-data/*). contrib/verify-cvs2svn.py checks the tips of all lines of development, but I don't think that it checks the contents "at various points in history". Michael ------------------------------------------------------ http://cvs2svn.tigris.org/ds/viewMessage.do?dsForumId=1667&dsMessageId=2401467 To unsubscribe from this discussion, e-mail: [[email protected]].