grim/youtrack-import

Parents cdadae07e61c
Children 6ec0d80db3e0
Fix the maxIssues bug where if you didn't specify a number of issues to import it didn't import any issues.
--- a/bitbucket/cmd.go Tue Aug 04 03:03:06 2020 -0500
+++ b/bitbucket/cmd.go Tue Aug 04 20:19:15 2020 -0500
@@ -9,7 +9,7 @@
Archive string `kong:"arg,name='archive',help='The zip file containing the archive'"`
Repository string `kong:"arg,name='repository',help='The repository name on bitbucket.'"`
UsersMapFile string `kong:"arg,name="users-map",help='A key=value file mapping emails to display names'"`
- MaxIssues int `kong:"flag,name='max-issues',short='x',help='The maximum number of issues to import.', default='-1'"`
+ 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 {
--- a/trac/cmd.go Tue Aug 04 03:03:06 2020 -0500
+++ b/trac/cmd.go Tue Aug 04 20:19:15 2020 -0500
@@ -10,7 +10,7 @@
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='-1'"`
+ 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 {
--- a/youtrack/import.go Tue Aug 04 03:03:06 2020 -0500
+++ b/youtrack/import.go Tue Aug 04 20:19:15 2020 -0500
@@ -23,7 +23,7 @@
// now adjust the length of issues if the user has requested import a
// maximum number of issues.
- if maxIssues >= 0 {
+ if maxIssues > 0 {
p.Issues = p.Issues[:maxIssues]
}