Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F142865405
D51203.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D51203.id.diff
View Options
diff --git a/tools/tools/git/mfc-candidates.lua b/tools/tools/git/mfc-candidates.lua
--- a/tools/tools/git/mfc-candidates.lua
+++ b/tools/tools/git/mfc-candidates.lua
@@ -117,41 +117,17 @@
local function usage(from_branch, to_branch, author)
local script_name = arg[0]:match("([^/]+)$")
- print(script_name .. " [-ah] [-f from_branch] [-t to_branch] [-u user] [-X exclude_file] [path ...]")
+ print(script_name .. " [-ah] [-f from_branch] [-r remote] [-t to_branch] [-u user] [-X exclude_file] [path ...]")
print()
params(from_branch, to_branch, author)
end
-- Main function
local function main()
- local from_branch = "freebsd/main"
- local to_branch = ""
+ local remote = "freebsd"
local author = os.getenv("USER") or ""
local dirspec = nil
- local url = exec_command("git remote get-url freebsd")
- local freebsd_repo = string.match(url, "[^/]+$")
- freebsd_repo = string.gsub(freebsd_repo, ".git$", "")
- if freebsd_repo == "ports" or freebsd_repo == "freebsd-ports" then
- local year = os.date("%Y")
- local month = os.date("%m")
- local qtr = math.ceil(month / 3)
- to_branch = "freebsd/" .. year .. "Q" .. qtr
- elseif freebsd_repo == "src" or freebsd_repo == "freebsd-src" then
- to_branch = "freebsd/stable/14"
- -- If pwd is a stable or release branch tree, default to it.
- local cur_branch = exec_command("git symbolic-ref --short HEAD")
- if string.match(cur_branch, "^stable/") then
- to_branch = cur_branch
- elseif string.match(cur_branch, "^releng/") then
- to_branch = cur_branch
- local major = string.match(cur_branch, "%d+")
- from_branch = "freebsd/stable/" .. major
- end
- else
- print("pwd is not under a ports or src repository.")
- return
- end
local do_help = false
local exclude_file = nil
@@ -166,6 +142,9 @@
elseif opt == "-h" then
do_help = true
i = i + 1
+ elseif opt == "-r" then
+ remote = arg[i + 1]
+ i = i + 1
elseif opt == "-t" then
to_branch = arg[i + 1]
i = i + 1
@@ -183,6 +162,32 @@
i = i + 1
end
+ local from_branch = remote .. "/main"
+ local to_branch = ""
+ local url = exec_command("git remote get-url " .. remote)
+ local freebsd_repo = string.match(url, "[^/^:]+$")
+ freebsd_repo = string.gsub(freebsd_repo, ".git$", "")
+ if freebsd_repo == "ports" or freebsd_repo == "freebsd-ports" then
+ local year = os.date("%Y")
+ local month = os.date("%m")
+ local qtr = math.ceil(month / 3)
+ to_branch = remote .. "/" .. year .. "Q" .. qtr
+ elseif freebsd_repo == "src" or freebsd_repo == "freebsd-src" then
+ to_branch = remote .. "/stable/14"
+ -- If pwd is a stable or release branch tree, default to it.
+ local cur_branch = exec_command("git symbolic-ref --short HEAD")
+ if string.match(cur_branch, "^stable/") then
+ to_branch = cur_branch
+ elseif string.match(cur_branch, "^releng/") then
+ to_branch = cur_branch
+ local major = string.match(cur_branch, "%d+")
+ from_branch = remote .. "/stable/" .. major
+ end
+ else
+ print("pwd is not under a ports or src repository.")
+ return
+ end
+
if do_help then
usage(from_branch, to_branch, author)
return
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Jan 25, 7:38 AM (7 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27930420
Default Alt Text
D51203.id.diff (3 KB)
Attached To
Mode
D51203: mfc-candidates: allow to name the remote and work with ssh origin
Attached
Detach File
Event Timeline
Log In to Comment