Re: Tracking "branch heads"
Greg Ward <[email protected]> Wed, 16 Dec 2009 19:54:22 -0500
| Newsgroups | gmane.comp.version-control.subversion.cvs2svn.devel |
|---|---|
| Message-ID | <[email protected]> |
On Mon, Dec 14, 2009 at 3:19 PM, Greg Ward <[email protected]> wrote: > Cool. OK, here is a preliminary draft. This passes its test, but I > have not yet used it in production. I'll see how the design actually > works within the next 24 hours. For your amusement... It works, but the first thing I had to do with the LOD->head revnum mapping is invert it. That is, at any point in the conversion, I need to know if the current svn_commit is the head of a branch. So I first had to write this code in my custom HgOutputOption subclass: if self.head_revs is None: file = open(artifact_manager.get_temp_file(config.SVN_BRANCH_HEADS), 'rb') branch_heads = cPickle.load(file) file.close() self.head_revs = {} for ((id, name), revnum) in branch_heads.items(): self.head_revs[revnum] = (id, name) Then I can use self.head_revs during the course of the conversion. Obviously, this data has to be gathered as a branch/LOD -> revnum mapping. But its only user to date (me) actually needs the inverse mapping. My inclination is to leave the svn_branch_heads.pck file as-is, because that's the smallest patch to cvs2svn. Anyone who knows enough to open and read that file probably also knows how to invert a dictionary. But there is the chance that I'll be imposing those extra 3 lines on every future user of this mapping. Can you think of other reasons why knowing branch heads would be useful, and whether those uses are more likely to want branch->revnum or revnum->branch? Greg ------------------------------------------------------ http://cvs2svn.tigris.org/ds/viewMessage.do?dsForumId=1667&dsMessageId=2431006 To unsubscribe from this discussion, e-mail: [[email protected]].