This Trac instance is not used for development anymore!

We migrated our development workflow to git and Gitea.
To test the future redirection, replace trac by ariadne in the page URL.

source: ps/trunk/build/premake/premake5/scripts/changes.lua

Last change on this file was 24387, checked in by s0600204, 4 years ago

(1/2) Update premake5 to Alpha 15 - premake5 files

See CHANGES.txt below for the upstream-composed list of changes.

premake5.exe built by Stan

Accepted By: Stan (for Windows)
Trac Tickets: #5869
Differential Revision: https://code.wildfiregames.com/D3219

File size: 1.3 KB
Line 
1---
2-- Output a list of merged PRs since last release in the CHANGES.txt format.
3---
4
5local usage = "Usage: premake5 --file=scripts/changes.lua --since=<rev> changes"
6
7local sinceRev = _OPTIONS["since"]
8
9if not sinceRev then
10 print(usage)
11 error("Missing `--since`", 0)
12end
13
14
15local function parsePullRequestId(line)
16 return line:match("#%d+%s")
17end
18
19local function parseTitle(line)
20 return line:match("||(.+)")
21end
22
23local function parseAuthor(line)
24 return line:match("%s([^%s]-)/")
25end
26
27local function parseLog(line)
28 local pr = parsePullRequestId(line)
29 local title = parseTitle(line)
30 local author = parseAuthor(line)
31 return string.format("* PR %s %s (@%s)", pr, title, author)
32end
33
34
35local function gatherChanges()
36 local cmd = string.format('git log HEAD "^%s" --merges --first-parent --format="%%s||%%b"', _OPTIONS["since"])
37 local output = os.outputof(cmd)
38
39 changes = {}
40
41 for line in output:gmatch("[^\r\n]+") do
42 table.insert(changes, parseLog(line))
43 end
44
45 return changes
46end
47
48
49local function generateChanges()
50 local changes = gatherChanges()
51 table.sort(changes)
52 for i = 1, #changes do
53 print(changes[i])
54 end
55end
56
57
58newaction {
59 trigger = "changes",
60 description = "Generate list of git merges in CHANGES.txt format",
61 execute = generateChanges
62}
63
64newoption {
65 trigger = "since",
66 value = "revision",
67 description = "Log merges since this revision"
68}
69
Note: See TracBrowser for help on using the repository browser.