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

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: 
1.9       asau       23: ### Experiences with Fossil
                     24: 
                     25: #### Aleksej Saushev (asau)
                     26: 
                     27: I started using it before conversion tool were available
                     28: (basically it isn't available yet, to my knowledge Joerg is working on it),
                     29: in addition I wanted to start as soon as possible
                     30: and to try operation with no conversion tool available.
                     31: Thus I've tried to simulate working with "vendor branches".
                     32: 
                     33: For now Fossil lacks some essential features and has other severe problems:
1.10      asau       34: 
1.9       asau       35: 1. No support for vendor branches.
1.11    ! wiki       36: * Redundant to "There's no support for importing vendor source"?
1.9       asau       37: 1. It is impossible to merge between trees growing from the very root.
                     38: The initial commit is too special, this prevents using these trees for vendor branches.
1.11    ! wiki       39: * Fixed in [4e3cd6ce4e].
1.9       asau       40: 1. There's no support for importing vendor source,
                     41: even "addremove" command isn't in trunk at the time of writing.
1.11    ! wiki       42: * It has been merged to trunk and is part of the pkgsrc version.
1.9       asau       43: 1. Merge state sticks. You can't undo it.
1.11    ! wiki       44: * Not sure what you mean, but "revert" resets the merge state since [d13054ce84].
1.9       asau       45: 1. You can't amend your source when you've just merged, you are forced to commit after merge.
1.11    ! wiki       46: * To clarify, the merge has to be committed first, no separate commits are possible from the checkout before that.
1.9       asau       47: 1. You can't tune diff command to ignore RCS keywords.
1.11    ! wiki       48: * Since RCS keywords are not really a native command, it is no surprise. An external diff program can be used for this purpose though.
1.9       asau       49: 1. You can't diff single file between two given versions.
1.11    ! wiki       50: * diff --from version1 --to version2 path/to/file
1.9       asau       51: 1. There's no way to change commit messages.
1.11    ! wiki       52: * easily done via ui.
1.9       asau       53: 1. There's no documented way to select commit messages of current branch, or branch by given commit id.
                     54: Or there's a bug preventing it.
1.11    ! wiki       55: * fossil info <commitid>
1.9       asau       56: 1. Commands are underdocumented, usage messages don't list many available options.
                     57: This applies to trunk at least, there's a branch that states documentation as its goal.
                     58: 1. There's no convenient way to look at commit contents: files affected, diff.
1.11    ! wiki       59: * fossil ui and use a web browser
1.9       asau       60: 
                     61: Some of above problems are reported.
                     62: 
                     63: Note, all problems above are usability problems, I didn't explore e.g. scalability,
                     64: Joerg did and had problems, but this is another story.
                     65: 
1.2       spz        66: ### Experiences with git
                     67: 
                     68: please fill in
                     69: 
                     70: ### Experiences with Subversion
                     71: 
                     72: please fill in
                     73: 
1.8       wiki       74: ### Experiences with Bazaar
                     75: 
                     76: #### Jonathan Perkin (sketch)
                     77: 
                     78: We use bzr at work (MySQL), and while it has a number of problems, it does make dev work easy.
                     79: 
                     80: The Good
                     81: 
                     82: * easy to use
                     83: * shared repositories keep local disk usage down
                     84: * commercial backing (Canonical)
                     85: * cross-platform (works on Windows)
                     86: * numerous GUI available
                     87: 
                     88: The Bad:
                     89: 
                     90: * slow
                     91: * requires python
                     92: 
                     93: The Ugly:
                     94: 
                     95: * can be really slow
                     96: * changing repository formats is a hassle
                     97: 
                     98: A basic example workflow
                     99: 
                    100: <pre>
                    101: # create a local shared repository. all objects are held in a .bzr sub-directory, with branches essentially a lightweight checkout
                    102: $ bzr init-repo bzr
                    103: $ cd bzr
                    104: 
                    105: # fetch HEAD, will take a long time, depending on connectivity
                    106: $ bzr branch bzr+ssh://bzr.netbsd.org/netbsd-trunk
                    107: 
                    108: # 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
                    109: $ bzr branch bzr+ssh://bzr.netbsd.org//netbsd-5
                    110: 
                    111: # ok, let's do some dev work
                    112: $ bzr branch netbsd-trunk netbsd-trunk-sketch-fix-msk
                    113: $ cd netbsd-trunk-sketch-fix-msk; hack hack hack
                    114: 
                    115: # the usual cycle of hack/commit/merge
                    116: $ bzr diff # show uncommitted diffs
                    117: $ bzr commit # commit to local clone
                    118: $ bzr merge ../netbsd-trunk # update clone to latest local trunk, OR
                    119: $ bzr merge bzr+ssh://bzr.netbsd.org/netbsd-trunk # merge directly from upstream
                    120: 
                    121: # publish our tree for others to review/hack on
                    122: $ bzr push bzr+ssh://bzr.netbsd.org/netbsd-trunk-fix-msk
                    123: 
                    124: # got reviewed/tested, let's push it
                    125: $ bzr merge bzr+ssh://bzr.netbsd.org/netbsd-trunk
                    126: $ bzr missing bzr+ssh://bzr.netbsd.org/netbsd-trunk # show changeset differences
                    127: $ bzr push bzr+ssh://bzr.netbsd.org/netbsd-trunk
                    128: </pre>
                    129: 
                    130: I personally find this approach a lot more natural than git's way of managing branches itself inside a single working directory.
                    131: 
1.2       spz       132: ***
                    133: 
1.1       spz       134: ## Conversion experiences
                    135: 
1.6       wiki      136: ### git
                    137: 
1.5       wiki      138: 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).
                    139: There have been no reports of errors in the other modules; this may be due to a lack of testing.
1.6       wiki      140: 
                    141: ### hg
                    142: 
                    143: 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:
                    144: <pre>
                    145:         self.ui = ui.ui(interactive = False)
                    146: </pre>
                    147: wants to be
                    148: <pre>
                    149:         self.ui = ui.ui()
                    150:         self.ui.setconfig('ui', 'interactive', 'off')
                    151: </pre>
                    152: in /usr/pkg/share/fromcvs/tohg.py line 10 (easily fixed, obviously)
                    153: and
                    154: <pre>
                    155:         n = self.hgrepo.commit(files = files,
                    156:                                text = text,
                    157:                                user = user,
                    158:                                date = "%s 0" % date,
                    159:                                p1 = p1,
                    160:                                p2 = p2,
                    161:                                extra = {'branch': branch})
                    162: </pre>
                    163: needs to be replaces with something that works with the 1.4 commit that looks like this:
                    164: <pre>
                    165:     def commit(self, text="", user=None, date=None, match=None, force=False,
                    166:                editor=False, extra={}):
                    167: </pre>
                    168: which is where I remembered that I wasn't planning to learn Python this week.
                    169: 
                    170: Next try: hg convert on pkgsrc
                    171: <pre>
                    172: --- /usr/pkg/lib/python2.6/site-packages/hgext/convert/cvsps.py 2009-12-02 01:30:45.000000000 +0000
                    173: +++ /tmp/cvsps.py       2010-01-20 12:52:11.000000000 +0000
                    174: @@ -271,14 +271,14 @@
                    175:                  tags[rev].append(match.group(1))
                    176:                  branchmap[match.group(1)] = match.group(2)
                    177:  
                    178: -            elif re_31.match(line):
                    179: +            elif re_31.match(line) and re_50.match(peek):
                    180:                  state = 5
                    181:              elif re_32.match(line):
                    182:                  state = 0
                    183:  
                    184:          elif state == 4:
                    185:              # expecting '------' separator before first revision
                    186: -            if re_31.match(line):
                    187: +            if re_31.match(line) and re_50.match(peek):
                    188:                  state = 5
                    189:              else:
                    190:                  assert not re_32.match(line), _('must have at least '
                    191: @@ -357,7 +357,7 @@
                    192:  
                    193:          elif state == 8:
                    194:              # store commit log message
                    195: -            if re_31.match(line):
                    196: +            if re_31.match(line) and re_50.match(peek):
                    197:                  state = 5
                    198:                  store = True
                    199:              elif re_32.match(line):
                    200: </pre>
                    201: helps it to cope with the output of cvs rlog -N -r1.66 pkgsrc/databases/rrdtool/Makefile (that's the easy one)
                    202: but then it tries to parse the output of (eg) cvs rlog -N -r1.19 pkgsrc/graphics/dcraw/Makefile and it's not clear
                    203: 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      204: 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