SVN conversion questions

Jeff Squyres jsquyres at cisco.com
Sun Mar 30 10:30:53 CDT 2008


Many thanks for your answers; sorry it took me so long to reply.  I'm  
currently playing with hg with low frequency (meaning: mostly on  
weekends) -- we're not planning any repository technology changes  
until after our upcoming major release, which is at least 2-3 months  
away.


On Mar 24, 2008, at 1:46 PM, Patrick Mézard wrote:

> I am tempted to add a way to specify exactly what branches are being  
> converted. I am not sure where to put that yet, ideas are welcome.  
> Maybe as a comma separated lists of svn paths (is comma allowed in  
> svn paths ?). That would also enable support for deleted branches.

How about always picking up everything in the SVN repo unless told  
otherwise?  I would assume that if you're converting an SVN repo to  
mercurial, you'd want *everything* from history.  Even if you didn't  
necessarily want everything, wouldn't it be more conservative to  
convert everything and let the user prune the final result if there  
was more than they wanted (or perhaps use an option that says "only  
grab trunk, tags, branches").

Or if you don't want to change the default behavior, perhaps:

     --config convert.svn.import_everything=1

>> So why is v1.2.3 listed separately, and what does "(inactive)" mean?
>
> Because:
> """
> found parent of branch /branches/v1.2lanl at 15181: /tags/v1.2- 
> series/v1.2.3
> """
> v1.2lanl is built on top of v1.2.3. It means the named branch  
> "v1.2.3" has no head and is thus marked "(inactive)".

Gothca; makes perfect sense.

>> $ hg tags
>> tip                            12553:4c250886b062
>> v1.2.5                         12026:983af2eb8dc1
>> v1.2.4                         11996:38355f2966f5
>> v1.2.2                         11910:bfff71e6d781
>> v1.2.1                         11892:8121aceeda27
>> v1.2.0                         11844:5f785b73c205
>>
>> How do I get it to pick up the rest of the tags?

Mixing in your other reply:

 > Should be fixed in crew-stable by 5efd447a9b8d.

Perfect; I confirm that it works when converting our SVN repo.  Many  
thanks!

-----
[8:20] svbu-mpi:~/hg/sh-svn/ompi-svnroot-hg % hg tags
tip                            12553:92afcbd9bca6
v1.1.5                         12425:d190e25076f5
v1.1.4                         12402:e47987966172
v1.1.3                         12378:b041139d7ba2
v1.1.2                         12344:0e37be60ee8f
v1.1.1                         12289:a974bf47fb0f
v1.1.0                         12208:e3f78936c9c0
v1.2.5                         12026:9c995c482294
v1.2.4                         11996:4312950cd400
v1.2.3                         11936:ebb7cf028db0
v1.2.2                         11910:814e38016028
v1.2.1                         11892:c87d095b5e8b
v1.2.0                         11844:5e9c67e26637
v1.0.2                          6370:d06d44f167e3
v1.0.1                          6209:b0ed4d4d81eb
v1.0.0                          6160:0133fc9ff7d2
-----

Here's two more off-the-wall SVN->mercurial conversion question...

1. I made an authors file to remap SVN commit usernames to proper name/ 
e-mail strings.  However, our project is a few years old; we've had both

a) individuals move between different member organizations, and
b) member organizations change e-mail domains

And therefore several members have had multiple different e-mail  
addresses over the years.  The SVN commit ID "jsquyres", for example,  
used to mean jsquyres at open dash mpi dot org, but now means jsquyres  
at cisco dot com.  Other SVN IDs have had 3 or more e-mail addresses  
associated with them (e.g., students interning at other Open MPI  
member organizations during the summer).

Is there a way to associate different e-mail addresses with a  
Subversion ID based on a time range?  Perhaps something like:

SVN_id="name and address string" start_date stop_date

jsquyres="Jeff Squyres <jsquyres at foo.example.com>" - 12/31/2006
jsquyres="Jeff Squyres <jsquyres at bar.example.com>" 01/01/2007 12/31/2007
jsquyres="Jeff Squyres <jsquyres at yow.example.com>" 01/01/2008 -

(where "-" means "beginning of time" or "end of time", depending on  
which field it was used)

...or something along these lines (date formats may vary, etc.).  For  
backwards compatibility, if no quotes are used, the whole line can be  
taken as the string -- the new start/stop date stuff can be used only  
if there are quotes.

I realize that this is a super-picky question :-) ; I'm just looking  
to see if we can be as accurate in the history as possible when  
converting from SVN to hg.

2. In our commit messages, we not-infrequently use strings of the form  
"r[0-9]+" to refer to other SVN commits.  We do this not only because  
it helps us track our code internally, but also because we use Trac  
for our bug tracking and SVN browsing.  When viewing SVN commits in  
the Trac browser, Trac automatically hyperlinks strings in the commit  
message matching "r[0-9]+" to the corresponding commit entry.

However, after converting to hg, these r numbers in commit messages  
will no longer be relevant, and we'll lose both the historical  
references and the [incredibly convenient] cross-hyperlinking.  Is  
there a way to get the conversion process to either change (or add)  
the "r[0-9]+" strings to the relevant mercurial hash ID?  Perhaps a  
commit message that reads like this:

Fix borked r1234 commit.

Could be changed to:

Fix borked 6d8ec087ecd6e874bb5f44a3616878db89632892 commit.
or
Fix borked r1234 (6d8ec087ecd6e874bb5f44a3616878db89632892) commit.

Thanks!

-- 
Jeff Squyres
Cisco Systems




More information about the Mercurial mailing list