Tracking "branch heads"
Greg Ward <[email protected]> Mon, 14 Dec 2009 09:37:59 -0500
| Newsgroups | gmane.comp.version-control.subversion.cvs2svn.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi all -- for converting from CVS to Mercurial (and probably other DVCSes), it would be nice for the OutputOption to know when it is processing the last revision on a particular branch. Eg. for Mercurial output, one could choose to mark that branch 'closed' or dummy-merge it into another branch. I believe that would be useful for Git and Bazaar output as well. I've peeked at the code, and it looks like the dumb way to do this is to add code to my custom OutputOption that duplicates the loop over all svn revisions in OutputPass.run(). That's fine if you're converting 1000 revisions in 5 minutes, but I'm converting 104,000 revisions and it takes ~14 hours. (Yeah, there is a performance problem there. Not sure if it's my code or Mercurial or just the plain fact that there are a lot more files in our rev 104000 than in rev 1000 or rev 20000.) So it looks like the clever thing to do is modify CreateRevsPass to build a dictionary mapping branch name to highest rev number on that branch, then ensure that dictionary is persisted somehow and available to OutputPass/OutputOption. Questions: 1) any interest in such a patch being accepted upstream? I'm pretty sure it will be orthogonal to my "add cvs2hg" patch series, so I could send it in as soon as it works, if you're interested. 2) terminology: in Mercurial, we would call this "a branch head" (or "the branch head" when dealing with CVS/svn data). AFAIK, CVS has no standard terminology. What does Subversion call "the highest-numbered rev on branch X"? What should cvs2svn call it internally? 3) how should I persist the dict? it'll be small enough to just write a pickle in the tmp dir: is that acceptable? 4) how should I make it available to OutputPass/OutputOption: just make the filename a constant somewhere and let the OutputOption author figure it out? Thanks -- Greg ------------------------------------------------------ http://cvs2svn.tigris.org/ds/viewMessage.do?dsForumId=1667&dsMessageId=2430293 To unsubscribe from this discussion, e-mail: [[email protected]].