| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 316754d commit 5945537
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -24,3 +24,13 @@ | |||
| 24 | 24 | # or | |
| 25 | 25 | label.delete() | |
| 26 | 26 | # end delete | |
| 27 | + | ||
| 28 | + # use | ||
| 29 | + # Labels are defined as lists in issues and merge requests. The labels must | ||
| 30 | + # exist. | ||
| 31 | + issue = p.issues.create({'title': 'issue title', | ||
| 32 | + 'description': 'issue description', | ||
| 33 | + 'labels': ['foo']}) | ||
| 34 | + issue.labels.append('bar') | ||
| 35 | + issue.save() | ||
| 36 | + # end use | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -52,3 +52,9 @@ Delete a label for a project: | |||
| 52 | 52 | .. literalinclude:: labels.py | |
| 53 | 53 | :start-after: # delete | |
| 54 | 54 | :end-before: # end delete | |
| 55 | + | ||
| 56 | + Managing labels in issues and merge requests: | ||
| 57 | + | ||
| 58 | + .. literalinclude:: labels.py | ||
| 59 | + :start-after: # use | ||
| 60 | + :end-before: # end use | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,7 +13,8 @@ | |||
| 13 | 13 | # create | |
| 14 | 14 | mr = project.mergerequests.create({'source_branch': 'cool_feature', | |
| 15 | 15 | 'target_branch': 'master', | |
| 16 | - 'title': 'merge cool feature'}) | ||
| 16 | + 'title': 'merge cool feature', | ||
| 17 | + 'labels': ['label1', 'label2']}) | ||
| 17 | 18 | # end create | |
| 18 | 19 | ||
| 19 | 20 | # update | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -384,12 +384,12 @@ | |||
| 384 | 384 | issue.notes.create({ | |
| 385 | 385 | "body": "See the attached file: {}".format(uploaded_file["markdown"]) | |
| 386 | 386 | }) | |
| 387 | - # project file upload markdown | ||
| 387 | + # end project file upload markdown | ||
| 388 | 388 | ||
| 389 | 389 | # project file upload markdown custom | |
| 390 | 390 | uploaded_file = project.upload("filename.txt", filedata="data") | |
| 391 | 391 | issue = project.issues.get(issue_id) | |
| 392 | 392 | issue.notes.create({ | |
| 393 | 393 | "body": "See the [attached file]({})".format(uploaded_file["url"]) | |
| 394 | 394 | }) | |
| 395 | - # project file upload markdown | ||
| 395 | + # end project file upload markdown custom | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments