buildbot: config of my buildbot running on http://home.haerwu.biz:8010/
[vuplus_openembedded] / contrib / mtn2git / git2mtn.py
1 #!/usr/bin/env python
2
3 """
4   Copyright (C) 2006, 2007 Holger Hans Peter Freyther
5
6   Permission is hereby granted, free of charge, to any person obtaining a copy
7   of this software and associated documentation files (the "Software"), to deal
8   in the Software without restriction, including without limitation the rights
9   to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10   copies of the Software, and to permit persons to whom the Software is
11   furnished to do so, subject to the following conditions:
12
13   The above copyright notice and this permission notice shall be included in
14   all copies or substantial portions of the Software.
15
16   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19   AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21   OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22   THE SOFTWARE.
23 """
24
25 #############
26 #
27 # Use: This tool can merge one git-branch back to one branch in monotone
28 #
29 # Discussion:
30 #   Merging from git to a monotone branch. Currently I see two modes which
31 #   should be supported.
32 #
33 #    a) linear development. Only a couple of changes are done on top of the
34 #       branch and nothing get merged. In this case we can merge everything
35 #       back and each rev gets a cert with the branch.
36 #       This should be possible using programs like git-rebase.
37 #    b) we have merges inside our git-rev-list history. This means we need to
38 #       merge every revision and can't attach any branch certs to the revision.
39 #       And once we are done with this we will create a propagate like commit
40 #       entry and we can give that new revision a cert with the branch name.
41 #
42 #       This means working in git is treated like a branch!
43 #
44 #       One difficulty is with git. This propagate like commit will create a new revision
45 #       in monotone but none in git as both trees/manifests are the same. So what we have
46 #       to make sure is to use the latest mtn revision for a given mark/git revision. This
47 #       is where mtn2git.py needs to help. We will save a list of mtn revisions that have the
48 #       same git version and then will read every of them and check the branch certs and will
49 #       use the one matching our target branch!
50 #############