Open Design and Integration Environment

Hex Artifact Content
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2018 Conference, Houston/TX, US, Oct 15-19
Send your abstracts to tclconference@googlegroups.com or submit via the online form
by Aug 20.

Artifact 5770aa97ae5f5cf1eb77e35befb265449ba624d7:

Wiki page [Converting SVN to Fossil] by hypnotoad 2013-12-08 11:33:52.
0000: 44 20 32 30 31 33 2d 31 32 2d 30 38 54 31 31 3a  D 2013-12-08T11:
0010: 33 33 3a 35 32 2e 30 31 35 0a 4c 20 43 6f 6e 76  33:52.015.L Conv
0020: 65 72 74 69 6e 67 5c 73 53 56 4e 5c 73 74 6f 5c  erting\sSVN\sto\
0030: 73 46 6f 73 73 69 6c 0a 50 20 38 31 64 63 64 66  sFossil.P 81dcdf
0040: 62 30 62 30 31 34 33 64 32 36 30 38 34 66 31 32  b0b0143d26084f12
0050: 34 35 37 35 63 34 61 35 66 38 35 37 36 64 30 63  4575c4a5f8576d0c
0060: 35 64 0a 55 20 68 79 70 6e 6f 74 6f 61 64 0a 57  5d.U hypnotoad.W
0070: 20 31 35 32 35 0a 4d 69 67 72 61 74 69 6e 67 20   1525.Migrating 
0080: 66 72 6f 6d 20 53 56 4e 20 74 6f 20 46 6f 73 73  from SVN to Foss
0090: 69 6c 20 72 65 71 75 69 72 65 73 20 61 6e 20 69  il requires an i
00a0: 6e 74 65 72 6d 65 64 69 61 72 79 20 74 72 69 70  ntermediary trip
00b0: 20 74 68 72 6f 75 67 68 20 47 49 54 2e 0d 0a 3c   through GIT...<
00c0: 70 3e 0d 0a 4d 75 63 68 20 6f 66 20 74 68 65 20  p>..Much of the 
00d0: 63 6f 64 65 20 74 6f 20 64 6f 20 74 68 69 73 20  code to do this 
00e0: 77 61 73 20 63 72 69 62 62 65 64 20 66 72 6f 6d  was cribbed from
00f0: 20 69 6e 73 74 72 75 63 74 69 6f 6e 73 20 6f 6e   instructions on
0100: 20 73 71 6c 69 74 65 2e 6f 72 67 2e 20 3c 61 20   sqlite.org. <a 
0110: 68 72 65 66 3d 22 68 74 74 70 3a 2f 2f 77 77 77  href="http://www
0120: 2e 73 71 6c 69 74 65 2e 6f 72 67 2f 64 65 62 75  .sqlite.org/debu
0130: 67 31 2f 77 69 6b 69 3f 6e 61 6d 65 3d 43 6f 6f  g1/wiki?name=Coo
0140: 6b 62 6f 6f 6b 22 3e 6c 69 6e 6b 3c 2f 61 3e 2e  kbook">link</a>.
0150: 0d 0a 3c 70 3e 0d 0a 3c 76 65 72 62 61 74 69 6d  ..<p>..<verbatim
0160: 3e 0d 0a 23 21 2f 62 69 6e 2f 62 61 73 68 0d 0a  >..#!/bin/bash..
0170: 0d 0a 64 69 65 28 29 7b 0d 0a 09 65 63 68 6f 20  ..die(){...echo 
0180: 24 31 0d 0a 09 65 78 69 74 20 31 0d 0a 7d 0d 0a  $1...exit 1..}..
0190: 0d 0a 61 75 74 68 6f 72 73 3d 27 61 75 74 68 6f  ..authors='autho
01a0: 72 73 2e 74 78 74 27 0d 0a 66 6f 73 73 69 6c 75  rs.txt'..fossilu
01b0: 73 65 72 73 3d 27 75 73 65 72 73 2e 74 78 74 27  sers='users.txt'
01c0: 0d 0a 0d 0a 23 20 70 61 72 61 6d 65 74 65 72 73  ....# parameters
01d0: 3a 0d 0a 23 20 31 20 2d 20 75 73 65 72 6e 61 6d  :..# 1 - usernam
01e0: 65 20 6f 66 20 61 64 6d 69 6e 0d 0a 23 20 32 20  e of admin..# 2 
01f0: 2d 20 73 76 6e 20 72 65 70 6f 73 69 74 6f 72 79  - svn repository
0200: 20 74 6f 20 63 6f 6e 76 65 72 74 0d 0a 23 20 33   to convert..# 3
0210: 20 2d 20 6e 61 6d 65 20 6f 66 20 66 6f 73 73 69   - name of fossi
0220: 6c 20 72 65 70 6f 0d 0a 23 20 6e 6f 74 65 3a 20  l repo..# note: 
0230: 74 68 65 20 72 65 70 6f 73 69 74 6f 72 79 20 77  the repository w
0240: 69 6c 6c 20 62 65 20 63 72 65 61 74 65 64 20 72  ill be created r
0250: 69 67 68 74 20 68 65 72 65 21 0d 0a 0d 0a 69 66  ight here!....if
0260: 20 5b 20 22 24 33 22 20 3d 3d 20 22 22 20 5d 0d   [ "$3" == "" ].
0270: 0a 74 68 65 6e 0d 0a 09 65 63 68 6f 20 22 53 79  .then...echo "Sy
0280: 6e 74 61 78 3a 22 0d 0a 09 65 63 68 6f 20 22 20  ntax:"...echo " 
0290: 20 73 76 6e 32 66 6f 73 73 69 6c 20 75 73 65 72   svn2fossil user
02a0: 6e 61 6d 65 20 20 73 76 6e 2d 72 65 70 6f 2d 75  name  svn-repo-u
02b0: 72 6c 20 20 66 6f 73 73 69 6c 2d 72 65 70 6f 2d  rl  fossil-repo-
02c0: 6e 61 6d 65 22 0d 0a 09 64 69 65 20 20 22 50 6c  name"...die  "Pl
02d0: 65 61 73 65 20 6d 61 6b 65 20 73 75 72 65 20 79  ease make sure y
02e0: 6f 75 20 68 61 76 65 20 61 6c 6c 20 74 68 72 65  ou have all thre
02f0: 65 20 70 61 72 61 6d 65 74 65 72 73 20 73 65 74  e parameters set
0300: 21 22 0d 0a 66 69 0d 0a 0d 0a 65 63 68 6f 20 22  !"..fi....echo "
0310: 47 65 74 74 69 6e 67 20 75 73 65 72 20 6e 61 6d  Getting user nam
0320: 65 73 2e 2e 2e 22 0d 0a 0d 0a 73 76 6e 20 6c 6f  es..."....svn lo
0330: 67 20 22 24 32 22 20 7c 20 67 72 65 70 20 27 5e  g "$2" | grep '^
0340: 72 5b 30 2d 39 5d 27 20 7c 20 63 75 74 20 2d 66  r[0-9]' | cut -f
0350: 33 20 2d 64 27 20 27 20 7c 20 73 6f 72 74 20 2d  3 -d' ' | sort -
0360: 75 20 3e 20 24 66 6f 73 73 69 6c 75 73 65 72 73  u > $fossilusers
0370: 20 7c 7c 20 64 69 65 20 22 53 6f 6d 65 74 68 69   || die "Somethi
0380: 6e 67 20 77 65 6e 74 20 77 72 6f 6e 67 20 67 65  ng went wrong ge
0390: 74 74 69 6e 67 20 75 73 65 72 20 6e 61 6d 65 73  tting user names
03a0: 22 0d 0a 0d 0a 65 63 68 6f 20 22 43 6f 6e 76 65  "....echo "Conve
03b0: 72 74 69 6e 67 20 75 73 65 72 20 6e 61 6d 65 73  rting user names
03c0: 20 74 6f 20 75 73 61 62 6c 65 20 66 6f 72 6d 61   to usable forma
03d0: 74 2e 2e 2e 22 0d 0a 73 65 64 20 2d 65 20 27 73  t..."..sed -e 's
03e0: 2f 2e 2a 2f 26 20 3d 20 26 20 3c 26 3e 2f 27 20  /.*/& = & <&>/' 
03f0: 24 66 6f 73 73 69 6c 75 73 65 72 73 20 3e 20 24  $fossilusers > $
0400: 61 75 74 68 6f 72 73 20 7c 7c 20 64 69 65 20 22  authors || die "
0410: 43 6f 75 6c 64 20 6e 6f 74 20 63 6f 6e 76 65 72  Could not conver
0420: 74 20 75 73 65 72 20 6e 61 6d 65 73 22 0d 0a 0d  t user names"...
0430: 0a 65 63 68 6f 20 22 49 6d 70 6f 72 74 69 6e 67  .echo "Importing
0440: 20 66 72 6f 6d 20 53 56 4e 20 74 6f 20 67 69 74   from SVN to git
0450: 2e 20 20 54 68 69 73 20 77 69 6c 6c 20 74 61 6b  .  This will tak
0460: 65 20 73 6f 6d 65 20 74 69 6d 65 2c 20 62 65 20  e some time, be 
0470: 70 61 74 69 65 6e 74 21 22 0d 0a 0d 0a 67 69 74  patient!"....git
0480: 20 73 76 6e 20 63 6c 6f 6e 65 20 2d 2d 61 75 74   svn clone --aut
0490: 68 6f 72 73 2d 66 69 6c 65 3d 24 61 75 74 68 6f  hors-file=$autho
04a0: 72 73 20 2d 2d 75 73 65 72 6e 61 6d 65 3d 22 24  rs --username="$
04b0: 31 22 20 2d 2d 6e 6f 2d 6d 65 74 61 64 61 74 61  1" --no-metadata
04c0: 20 22 24 32 22 20 74 6d 70 20 7c 7c 20 64 69 65   "$2" tmp || die
04d0: 20 22 55 6e 61 62 6c 65 20 74 6f 20 69 6d 70 6f   "Unable to impo
04e0: 72 74 20 74 6f 20 67 69 74 22 0d 0a 0d 0a 65 63  rt to git"....ec
04f0: 68 6f 20 22 49 6d 70 6f 72 74 69 6e 67 20 66 72  ho "Importing fr
0500: 6f 6d 20 67 69 74 20 74 6f 20 66 6f 73 73 69 6c  om git to fossil
0510: 2e 20 20 54 68 69 73 20 77 69 6c 6c 20 61 6c 73  .  This will als
0520: 6f 20 74 61 6b 65 20 73 6f 6d 65 20 74 69 6d 65  o take some time
0530: 2c 20 73 61 64 6c 79 22 0d 0a 0d 0a 28 0d 0a 63  , sadly"....(..c
0540: 64 20 74 6d 70 0d 0a 67 69 74 20 66 61 73 74 2d  d tmp..git fast-
0550: 65 78 70 6f 72 74 20 2d 2d 66 75 6c 6c 2d 74 72  export --full-tr
0560: 65 65 20 2d 2d 61 6c 6c 20 7c 20 66 6f 73 73 69  ee --all | fossi
0570: 6c 20 69 6d 70 6f 72 74 20 2d 2d 67 69 74 20 2e  l import --git .
0580: 2e 2f 24 33 20 7c 7c 20 64 69 65 20 22 55 6e 61  ./$3 || die "Una
0590: 62 6c 65 20 74 6f 20 69 6d 70 6f 72 74 20 69 6e  ble to import in
05a0: 74 6f 20 66 6f 73 73 69 6c 22 0d 0a 29 0d 0a 0d  to fossil"..)...
05b0: 0a 65 63 68 6f 20 22 41 64 64 69 6e 67 20 75 73  .echo "Adding us
05c0: 65 72 73 20 74 6f 20 66 6f 73 73 69 6c 20 72 65  ers to fossil re
05d0: 70 6f 73 69 74 6f 72 79 3a 22 0d 0a 66 6f 72 20  pository:"..for 
05e0: 75 73 65 72 20 69 6e 20 60 63 61 74 20 24 66 6f  user in `cat $fo
05f0: 73 73 69 6c 75 73 65 72 73 60 0d 0a 64 6f 0d 0a  ssilusers`..do..
0600: 09 66 6f 73 73 69 6c 20 75 73 65 72 20 6e 65 77  .fossil user new
0610: 20 24 75 73 65 72 20 27 27 20 22 24 7b 75 73 65   $user '' "${use
0620: 72 7d 31 32 33 34 22 20 2d 52 20 24 33 0d 0a 09  r}1234" -R $3...
0630: 66 6f 73 73 69 6c 20 75 73 65 72 20 63 61 70 61  fossil user capa
0640: 62 69 6c 69 74 69 65 73 20 24 75 73 65 72 20 27  bilities $user '
0650: 76 27 20 2d 52 20 24 33 0d 0a 64 6f 6e 65 0d 0a  v' -R $3..done..
0660: 3c 2f 76 65 72 62 61 74 69 6d 3e 0a 5a 20 34 64  </verbatim>.Z 4d
0670: 38 33 34 35 33 64 65 37 32 61 65 65 37 64 37 37  83453de72aee7d77
0680: 39 61 66 63 33 64 34 39 34 30 38 36 63 62 0a     9afc3d494086cb.