File:  [NetBSD Developer Wiki] / wikisrc / mailing-lists / tech-repository.mdwn
Revision 1.15: download - view: text, annotated - select for diffs
Fri Dec 24 10:32:17 2010 UTC (11 years, 4 months ago) by wiki
Branches: MAIN
CVS tags: HEAD
web commit by spz: comment to git

    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
   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
   16: 
   17: Please add/correct.
   18: 
   19: ***
   20: 
   21: ## Experiences in using the software
   22: 
   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:
   34: 
   35: 1. Many operations require javascript-capable web browser.
   36: 1. No support for vendor branches.
   37: * Redundant to "There's no support for importing vendor source"?
   38: * No, it is different. I would import manually, if only some support were there.
   39: 1. It is impossible to merge between trees growing from the very root.
   40: The initial commit is too special, this prevents using these trees for vendor branches.
   41: * Fixed in [4e3cd6ce4e].
   42: * 2010-11-08, not in pkgsrc.
   43: 1. There's no support for importing vendor source,
   44: even "addremove" command isn't in trunk at the time of writing.
   45: * It has been merged to trunk and is part of the pkgsrc version.
   46: * No, it isn't part of pkgsrc version at the moment, TIAS.
   47: * Sorry, you are right. Merged to trunk in [ceab53718f].
   48: 1. Merge state sticks. You can't undo it.
   49: * Not sure what you mean, but "revert" resets the merge state since [d13054ce84].
   50: * This is quite recent (late October) fix, I didn't check it.
   51: 1. You can't amend your source when you've just merged, you are forced to commit after merge.
   52: * To clarify, the merge has to be committed first, no separate commits are possible from the checkout before that.
   53: * In practice this makes _critical_ defect in combination of "fossil diff" inability to generate difference for added files.
   54: 1. You can't tune diff command to ignore RCS keywords.
   55: * Since RCS keywords are not really a native command, it is no surprise. An external diff program can be used for this purpose though.
   56: * Since there's no external diff program that supports it, it is really not quite easy.
   57: 1. You can't diff single file between two given versions.
   58: * diff --from version1 --to version2 path/to/file
   59: * That didn't work, and I'm not sure it works now. It used to ignore path-to-file argument. (It used to bail out when both "--from" and "--to" were used.)
   60: 1. There's no way to change commit messages.
   61: * easily done via ui: select a commit and under "Other Links" you can find "Edit" (given the necessary permissions).
   62: * How? It should be possible via command line nevertheless.
   63: 1. There's no documented way to select commit messages of current branch, or branch by given commit id.
   64: Or there's a bug preventing it.
   65: * fossil info <commitid>
   66: * This isn't about "info" command, it is about "timeline"
   67: --> Please clarify what you mean.
   68: * BTW, this command doesn't support "-R" flag, perhaps you have to check the source out to use it.
   69: 1. Commands are under-documented, usage messages don't list many available options.
   70: This applies to trunk at least, there's a branch that states documentation as its goal.
   71: 1. There's no convenient way to look at commit contents: files affected, diff.
   72: * fossil ui and use a web browser
   73: * We don't have web browser in base system, this information should be accessible with command line.
   74: 
   75: 
   76: Some of above problems are reported.
   77: 
   78: Note, all problems above are usability problems, I didn't explore e.g. scalability,
   79: Joerg did and had problems, but this is another story.
   80: 
   81: ### Experiences with git
   82: 
   83: Experience with the imported repositories on morden:
   84: - no problem in principle with the smaller modules like othersrc or htdocs (CVS tags are one off but that is expected)
   85: - the large repos are really fragile, and gits idea of how to fix a broken repo seems to be to retrieve a copy from someone/somewhere that happens to not be broken
   86: 
   87: ### Experiences with Subversion
   88: 
   89: please fill in
   90: 
   91: ### Experiences with Bazaar
   92: 
   93: #### Jonathan Perkin (sketch)
   94: 
   95: We use bzr at work (MySQL), and while it has a number of problems, it does make dev work easy.
   96: 
   97: The Good
   98: 
   99: * easy to use
  100: * shared repositories keep local disk usage down
  101: * commercial backing (Canonical)
  102: * cross-platform (works on Windows)
  103: * numerous GUI available
  104: 
  105: The Bad:
  106: 
  107: * slow
  108: * requires python
  109: 
  110: The Ugly:
  111: 
  112: * can be really slow
  113: * changing repository formats is a hassle
  114: 
  115: A basic example workflow
  116: 
  117: <pre>
  118: # create a local shared repository. all objects are held in a .bzr sub-directory, with branches essentially a lightweight checkout
  119: $ bzr init-repo bzr
  120: $ cd bzr
  121: 
  122: # fetch HEAD, will take a long time, depending on connectivity
  123: $ bzr branch bzr+ssh://bzr.netbsd.org/netbsd-trunk
  124: 
  125: # 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
  126: $ bzr branch bzr+ssh://bzr.netbsd.org//netbsd-5
  127: 
  128: # ok, let's do some dev work
  129: $ bzr branch netbsd-trunk netbsd-trunk-sketch-fix-msk
  130: $ cd netbsd-trunk-sketch-fix-msk; hack hack hack
  131: 
  132: # the usual cycle of hack/commit/merge
  133: $ bzr diff # show uncommitted diffs
  134: $ bzr commit # commit to local clone
  135: $ bzr merge ../netbsd-trunk # update clone to latest local trunk, OR
  136: $ bzr merge bzr+ssh://bzr.netbsd.org/netbsd-trunk # merge directly from upstream
  137: 
  138: # publish our tree for others to review/hack on
  139: $ bzr push bzr+ssh://bzr.netbsd.org/netbsd-trunk-fix-msk
  140: 
  141: # got reviewed/tested, let's push it
  142: $ bzr merge bzr+ssh://bzr.netbsd.org/netbsd-trunk
  143: $ bzr missing bzr+ssh://bzr.netbsd.org/netbsd-trunk # show changeset differences
  144: $ bzr push bzr+ssh://bzr.netbsd.org/netbsd-trunk
  145: </pre>
  146: 
  147: I personally find this approach a lot more natural than git's way of managing branches itself inside a single working directory.
  148: 
  149: ***
  150: 
  151: ## Conversion experiences
  152: 
  153: ### git
  154: 
  155: 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).
  156: There have been no reports of errors in the other modules; this may be due to a lack of testing.
  157: 
  158: ### hg
  159: 
  160: 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:
  161: <pre>
  162:         self.ui = ui.ui(interactive = False)
  163: </pre>
  164: wants to be
  165: <pre>
  166:         self.ui = ui.ui()
  167:         self.ui.setconfig('ui', 'interactive', 'off')
  168: </pre>
  169: in /usr/pkg/share/fromcvs/tohg.py line 10 (easily fixed, obviously)
  170: and
  171: <pre>
  172:         n = self.hgrepo.commit(files = files,
  173:                                text = text,
  174:                                user = user,
  175:                                date = "%s 0" % date,
  176:                                p1 = p1,
  177:                                p2 = p2,
  178:                                extra = {'branch': branch})
  179: </pre>
  180: needs to be replaces with something that works with the 1.4 commit that looks like this:
  181: <pre>
  182:     def commit(self, text="", user=None, date=None, match=None, force=False,
  183:                editor=False, extra={}):
  184: </pre>
  185: which is where I remembered that I wasn't planning to learn Python this week.
  186: 
  187: Next try: hg convert on pkgsrc
  188: <pre>
  189: --- /usr/pkg/lib/python2.6/site-packages/hgext/convert/cvsps.py 2009-12-02 01:30:45.000000000 +0000
  190: +++ /tmp/cvsps.py       2010-01-20 12:52:11.000000000 +0000
  191: @@ -271,14 +271,14 @@
  192:                  tags[rev].append(match.group(1))
  193:                  branchmap[match.group(1)] = match.group(2)
  194:  
  195: -            elif re_31.match(line):
  196: +            elif re_31.match(line) and re_50.match(peek):
  197:                  state = 5
  198:              elif re_32.match(line):
  199:                  state = 0
  200:  
  201:          elif state == 4:
  202:              # expecting '------' separator before first revision
  203: -            if re_31.match(line):
  204: +            if re_31.match(line) and re_50.match(peek):
  205:                  state = 5
  206:              else:
  207:                  assert not re_32.match(line), _('must have at least '
  208: @@ -357,7 +357,7 @@
  209:  
  210:          elif state == 8:
  211:              # store commit log message
  212: -            if re_31.match(line):
  213: +            if re_31.match(line) and re_50.match(peek):
  214:                  state = 5
  215:                  store = True
  216:              elif re_32.match(line):
  217: </pre>
  218: helps it to cope with the output of cvs rlog -N -r1.66 pkgsrc/databases/rrdtool/Makefile (that's the easy one)
  219: but then it tries to parse the output of (eg) cvs rlog -N -r1.19 pkgsrc/graphics/dcraw/Makefile and it's not clear
  220: to me how it could hope to get that one right just from cvs rlog, and all alternatives are going to be rather tedious
  221: 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