grim/youtrack-import
Clone
Summary
Browse
Changes
Graph
Disable the issue linker and only mentioned previously discarded comments once
draft
2020-09-01, Gary Kramlich
d8a71dd2be73
Disable the issue linker and only mentioned previously discarded comments once
package
trac
import
(
"keep.imfreedom.org/grim/youtrack-import/globals"
"keep.imfreedom.org/grim/youtrack-import/mem"
"keep.imfreedom.org/grim/youtrack-import/youtrack"
)
type
Cmd
struct
{
EnvPath
string
`kong:"arg,name='tracenv',help='The path to the trac environment'"`
ImportUsers
string
`kong:"flag,name='import-users',help='The json file of users to import',required='true',type='existingfile'"`
UnknownUser
string
`kong:"flag,name='unknown-user',help='The login name to use for unknown users',default='ghost'"`
MaxIssues
int
`kong:"flag,name='max-issues',short='x',help='The maximum number of issues to import.', default='0'"`
}
func
(
c
*
Cmd
)
Run
(
g
*
globals
.
Globals
)
error
{
mem
.
PrintMemUsage
()
env
,
err
:=
NewEnvironment
(
c
.
EnvPath
)
if
err
!=
nil
{
return
err
}
project
,
err
:=
createProject
(
g
.
ProjectID
,
env
,
c
.
ImportUsers
,
c
.
UnknownUser
)
mem
.
PrintMemUsage
()
if
err
!=
nil
{
return
err
}
if
err
:=
env
.
close
();
err
!=
nil
{
return
err
}
return
youtrack
.
Import
(
g
,
project
,
c
.
MaxIssues
)
}