Annotation of wikisrc/mailing-lists/tech-repository.mdwn, revision 1.8

1.1       spz         1: ## Requirements
                      2: 
                      3: A list of requirements for a possible replacement for CVS as repo software for NetBSD and pkgsrc so we don't keep starting over listing these (and forgetting half) all of the time:
                      4: 
                      5: - the license would be nice to be BSDish, must be open source and free to use
                      6: - the software should be includeable in NetBSD base without too much excess baggage
                      7: - it should be possible to do development on old or small hardware
                      8: - it must support automated updating of source trees
                      9: - it must support branches
                     10: - there should be a conversion for the present history (that actually works)
                     11: - the resulting repository must not break easily
                     12: - the software should be reasonably mature and reliable
1.3       spz        13: - checkout of a pkgsrc tree must be feasible on a 32MB system
                     14: - checkout of a stable pkgsrc tree and then updating select package subdirs to the latest version of the main branch should be possible
                     15: - lasting removal of legally tainted code must be possible
1.1       spz        16: 
                     17: Please add/correct.
                     18: 
                     19: ***
                     20: 
1.2       spz        21: ## Experiences in using the software
                     22: 
                     23: ### Experiences with git
                     24: 
                     25: please fill in
                     26: 
                     27: ### Experiences with Subversion
                     28: 
                     29: please fill in
                     30: 
1.8     ! wiki       31: ### Experiences with Bazaar
        !            32: 
        !            33: #### Jonathan Perkin (sketch)
        !            34: 
        !            35: We use bzr at work (MySQL), and while it has a number of problems, it does make dev work easy.
        !            36: 
        !            37: The Good
        !            38: 
        !            39: * easy to use
        !            40: * shared repositories keep local disk usage down
        !            41: * commercial backing (Canonical)
        !            42: * cross-platform (works on Windows)
        !            43: * numerous GUI available
        !            44: 
        !            45: The Bad:
        !            46: 
        !            47: * slow
        !            48: * requires python
        !            49: 
        !            50: The Ugly:
        !            51: 
        !            52: * can be really slow
        !            53: * changing repository formats is a hassle
        !            54: 
        !            55: A basic example workflow
        !            56: 
        !            57: <pre>
        !            58: # create a local shared repository. all objects are held in a .bzr sub-directory, with branches essentially a lightweight checkout
        !            59: $ bzr init-repo bzr
        !            60: $ cd bzr
        !            61: 
        !            62: # fetch HEAD, will take a long time, depending on connectivity
        !            63: $ bzr branch bzr+ssh://bzr.netbsd.org/netbsd-trunk
        !            64: 
        !            65: # fetch netbsd-5, as we already have the majority of the code in netbsd-trunk (and therefore .bzr), this takes a fraction of the time
        !            66: $ bzr branch bzr+ssh://bzr.netbsd.org//netbsd-5
        !            67: 
        !            68: # ok, let's do some dev work
        !            69: $ bzr branch netbsd-trunk netbsd-trunk-sketch-fix-msk
        !            70: $ cd netbsd-trunk-sketch-fix-msk; hack hack hack
        !            71: 
        !            72: # the usual cycle of hack/commit/merge
        !            73: $ bzr diff # show uncommitted diffs
        !            74: $ bzr commit # commit to local clone
        !            75: $ bzr merge ../netbsd-trunk # update clone to latest local trunk, OR
        !            76: $ bzr merge bzr+ssh://bzr.netbsd.org/netbsd-trunk # merge directly from upstream
        !            77: 
        !            78: # publish our tree for others to review/hack on
        !            79: $ bzr push bzr+ssh://bzr.netbsd.org/netbsd-trunk-fix-msk
        !            80: 
        !            81: # got reviewed/tested, let's push it
        !            82: $ bzr merge bzr+ssh://bzr.netbsd.org/netbsd-trunk
        !            83: $ bzr missing bzr+ssh://bzr.netbsd.org/netbsd-trunk # show changeset differences
        !            84: $ bzr push bzr+ssh://bzr.netbsd.org/netbsd-trunk
        !            85: </pre>
        !            86: 
        !            87: I personally find this approach a lot more natural than git's way of managing branches itself inside a single working directory.
        !            88: 
1.2       spz        89: ***
                     90: 
1.1       spz        91: ## Conversion experiences
                     92: 
1.6       wiki       93: ### git
                     94: 
1.5       wiki       95: Conversion of all modules to git succeeded using fromcvs togit. The resulting git repository of src contains several errors where files have a wrong version (eg in hunt/Makefile the contents of the file on the vendor branch appear as tip of the master branch, which is quite wrong).
                     96: There have been no reports of errors in the other modules; this may be due to a lack of testing.
1.6       wiki       97: 
                     98: ### hg
                     99: 
                    100: Conversion of src failed. Afair the rest worked when using Mercurial 1.3.*. Alas, fromcvs tohg is not compatible with Mercurial 1.4 which is in pkgsrc now and is the version to use with Python 2.6 (afair). Two identified problems:
                    101: <pre>
                    102:         self.ui = ui.ui(interactive = False)
                    103: </pre>
                    104: wants to be
                    105: <pre>
                    106:         self.ui = ui.ui()
                    107:         self.ui.setconfig('ui', 'interactive', 'off')
                    108: </pre>
                    109: in /usr/pkg/share/fromcvs/tohg.py line 10 (easily fixed, obviously)
                    110: and
                    111: <pre>
                    112:         n = self.hgrepo.commit(files = files,
                    113:                                text = text,
                    114:                                user = user,
                    115:                                date = "%s 0" % date,
                    116:                                p1 = p1,
                    117:                                p2 = p2,
                    118:                                extra = {'branch': branch})
                    119: </pre>
                    120: needs to be replaces with something that works with the 1.4 commit that looks like this:
                    121: <pre>
                    122:     def commit(self, text="", user=None, date=None, match=None, force=False,
                    123:                editor=False, extra={}):
                    124: </pre>
                    125: which is where I remembered that I wasn't planning to learn Python this week.
                    126: 
                    127: Next try: hg convert on pkgsrc
                    128: <pre>
                    129: --- /usr/pkg/lib/python2.6/site-packages/hgext/convert/cvsps.py 2009-12-02 01:30:45.000000000 +0000
                    130: +++ /tmp/cvsps.py       2010-01-20 12:52:11.000000000 +0000
                    131: @@ -271,14 +271,14 @@
                    132:                  tags[rev].append(match.group(1))
                    133:                  branchmap[match.group(1)] = match.group(2)
                    134:  
                    135: -            elif re_31.match(line):
                    136: +            elif re_31.match(line) and re_50.match(peek):
                    137:                  state = 5
                    138:              elif re_32.match(line):
                    139:                  state = 0
                    140:  
                    141:          elif state == 4:
                    142:              # expecting '------' separator before first revision
                    143: -            if re_31.match(line):
                    144: +            if re_31.match(line) and re_50.match(peek):
                    145:                  state = 5
                    146:              else:
                    147:                  assert not re_32.match(line), _('must have at least '
                    148: @@ -357,7 +357,7 @@
                    149:  
                    150:          elif state == 8:
                    151:              # store commit log message
                    152: -            if re_31.match(line):
                    153: +            if re_31.match(line) and re_50.match(peek):
                    154:                  state = 5
                    155:                  store = True
                    156:              elif re_32.match(line):
                    157: </pre>
                    158: helps it to cope with the output of cvs rlog -N -r1.66 pkgsrc/databases/rrdtool/Makefile (that's the easy one)
                    159: but then it tries to parse the output of (eg) cvs rlog -N -r1.19 pkgsrc/graphics/dcraw/Makefile and it's not clear
                    160: to me how it could hope to get that one right just from cvs rlog, and all alternatives are going to be rather tedious
1.7       wiki      161: and I'm still not planning to learn Python this week. If you feel more energetic, feel free to hand over patches.

CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb