Fossil SCM

fossil-scm / www / json-api / api-branch.md
Source Blame History 86 lines
e30d67a… stephan 1 # JSON API: /branch
e30d67a… stephan 2 ([⬑JSON API Index](index.md))
e30d67a… stephan 3
e30d67a… stephan 4 Jump to:
e30d67a… stephan 5
e30d67a… stephan 6 * [Branch List](#list)
e30d67a… stephan 7 * [Create Branch](#create)
e30d67a… stephan 8
e30d67a… stephan 9 ---
e30d67a… stephan 10
e30d67a… stephan 11 <a id="list"></a>
e30d67a… stephan 12 # Branch List
e30d67a… stephan 13
e30d67a… stephan 14 **Status:** implemented, at least in draft form, on 20110921.
e30d67a… stephan 15
e30d67a… stephan 16 **Required privileges:** "o"
e30d67a… stephan 17
e30d67a… stephan 18 **Request:** `/json/branch/list`
e30d67a… stephan 19
e30d67a… stephan 20 **Response payload example:**
e30d67a… stephan 21
e30d67a… stephan 22 ```json
e30d67a… stephan 23 {
e30d67a… stephan 24 "range":"closed",
e30d67a… stephan 25 "current":"json", /* only when there is a local opened checkout */
e30d67a… stephan 26 "branches":[
e30d67a… stephan 27 "artifact_description",
e30d67a… stephan 28 "bch",
e30d67a… stephan 29 "ben-changes-report",
e30d67a… stephan 30 "ben-safe-make",
e30d67a… stephan 31 "ben-security",
e30d67a… stephan 32 "ben-testing",
e30d67a… stephan 33
e30d67a… stephan 34 ]
e30d67a… stephan 35 }
e30d67a… stephan 36 ```
e30d67a… stephan 37
e30d67a… stephan 38 *Potential* TODO: add "tip" property which names the most recently
e30d67a… stephan 39 modified branch? (How to get this?)
e30d67a… stephan 40
e30d67a… stephan 41 HTTP GET/`POST.payload` options:
e30d67a… stephan 42
e30d67a… stephan 43 - `range`: a string in the set ("open", "closed", "all"),
e30d67a… stephan 44 case-sensitive, but only the first letter is actually evaluated.
e30d67a… stephan 45 Default="open". Only branches with this state are returned.
e30d67a… stephan 46
e30d67a… stephan 47 CLI mode options (same semantics as HTTP equivalents), must come last on
e30d67a… stephan 48 the CLI:
e30d67a… stephan 49
e30d67a… stephan 50 - `-r|--range all|closed|open`
e30d67a… stephan 51 - `-a` (equivalent to `-r all`)
e30d67a… stephan 52 - `-c` (equivalent to `-r closed`). Only one of `-a`/`-c` may be specified,
e30d67a… stephan 53 and if both are specified then which one takes precedence is
e30d67a… stephan 54 unspecified.
e30d67a… stephan 55
e30d67a… stephan 56
e30d67a… stephan 57 <a id="create"></a>
e30d67a… stephan 58 # Create Branch
e30d67a… stephan 59
e30d67a… stephan 60 **Status:** implemented 20111002
e30d67a… stephan 61
e30d67a… stephan 62 **Required privileges:** "w"
e30d67a… stephan 63
e30d67a… stephan 64 **Request:** `/json/branch/create`
e30d67a… stephan 65
e30d67a… stephan 66 **Request options:**
e30d67a… stephan 67
e30d67a… stephan 68 - `name=string` (REQUIRED) Name of new branch
e30d67a… stephan 69 - `basis=string` (default=trunk) Name of parent branch to branch from.
e30d67a… stephan 70 - `bgColor=string` (default=something ugly) In `#RRGGBB` form. (FIXME:
e30d67a… stephan 71 change the default to use fossil's random bgcolor technique.)
e30d67a… stephan 72 - `private=bool` (default=false) Determines whether the branch is
e30d67a… stephan 73 private or not.
e30d67a… stephan 74
e30d67a… stephan 75 **Response payload example:**
e30d67a… stephan 76
e30d67a… stephan 77 ```json
e30d67a… stephan 78 {
e30d67a… stephan 79 "name":"my-branch",
e30d67a… stephan 80 "basis":"my-other-branch",
e30d67a… stephan 81 "uuid":"de8115db4ce388ed8d0af666ae7d90e1410be4ca",
e30d67a… stephan 82 "isPrivate":true,
e30d67a… stephan 83 "bgColor":"#ff0000"
e30d67a… stephan 84 }
e30d67a… stephan 85 ```
e30d67a… stephan 86

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button