mirror of
https://github.com/MichaelMure/git-bug.git
synced 2024-12-15 02:01:43 +03:00
metaKeyJiraOperationId -> metaKeyJiraDerivedId
This commit is contained in:
parent
d349137ea5
commit
4827d3f9ab
@ -383,7 +383,7 @@ func (ji *jiraImporter) ensureChange(repo *cache.RepoCache, b *cache.BugCache, e
|
|||||||
// If we have an operation which is already mapped to the entire changelog
|
// If we have an operation which is already mapped to the entire changelog
|
||||||
// entry then that means this changelog entry was induced by an export
|
// entry then that means this changelog entry was induced by an export
|
||||||
// operation and we've already done the match, so we skip this one
|
// operation and we've already done the match, so we skip this one
|
||||||
_, err := b.ResolveOperationWithMetadata(metaKeyJiraOperationId, entry.ID)
|
_, err := b.ResolveOperationWithMetadata(metaKeyJiraDerivedId, entry.ID)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
return nil
|
return nil
|
||||||
} else if err != cache.ErrNoMatchingOp {
|
} else if err != cache.ErrNoMatchingOp {
|
||||||
@ -425,7 +425,7 @@ func (ji *jiraImporter) ensureChange(repo *cache.RepoCache, b *cache.BugCache, e
|
|||||||
opr, isRightType := potentialOp.(*bug.LabelChangeOperation)
|
opr, isRightType := potentialOp.(*bug.LabelChangeOperation)
|
||||||
if isRightType && labelSetsMatch(addedLabels, opr.Added) && labelSetsMatch(removedLabels, opr.Removed) {
|
if isRightType && labelSetsMatch(addedLabels, opr.Added) && labelSetsMatch(removedLabels, opr.Removed) {
|
||||||
_, err := b.SetMetadata(opr.Id(), map[string]string{
|
_, err := b.SetMetadata(opr.Id(), map[string]string{
|
||||||
metaKeyJiraOperationId: entry.ID,
|
metaKeyJiraDerivedId: entry.ID,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -437,7 +437,7 @@ func (ji *jiraImporter) ensureChange(repo *cache.RepoCache, b *cache.BugCache, e
|
|||||||
opr, isRightType := potentialOp.(*bug.SetStatusOperation)
|
opr, isRightType := potentialOp.(*bug.SetStatusOperation)
|
||||||
if isRightType && statusMap[opr.Status.String()] == item.To {
|
if isRightType && statusMap[opr.Status.String()] == item.To {
|
||||||
_, err := b.SetMetadata(opr.Id(), map[string]string{
|
_, err := b.SetMetadata(opr.Id(), map[string]string{
|
||||||
metaKeyJiraOperationId: entry.ID,
|
metaKeyJiraDerivedId: entry.ID,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -451,7 +451,7 @@ func (ji *jiraImporter) ensureChange(repo *cache.RepoCache, b *cache.BugCache, e
|
|||||||
opr, isRightType := potentialOp.(*bug.SetTitleOperation)
|
opr, isRightType := potentialOp.(*bug.SetTitleOperation)
|
||||||
if isRightType && opr.Title == item.To {
|
if isRightType && opr.Title == item.To {
|
||||||
_, err := b.SetMetadata(opr.Id(), map[string]string{
|
_, err := b.SetMetadata(opr.Id(), map[string]string{
|
||||||
metaKeyJiraOperationId: entry.ID,
|
metaKeyJiraDerivedId: entry.ID,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -467,7 +467,7 @@ func (ji *jiraImporter) ensureChange(repo *cache.RepoCache, b *cache.BugCache, e
|
|||||||
opr.Target == b.Snapshot().Operations[0].Id() &&
|
opr.Target == b.Snapshot().Operations[0].Id() &&
|
||||||
opr.Message == item.ToString {
|
opr.Message == item.ToString {
|
||||||
_, err := b.SetMetadata(opr.Id(), map[string]string{
|
_, err := b.SetMetadata(opr.Id(), map[string]string{
|
||||||
metaKeyJiraOperationId: entry.ID,
|
metaKeyJiraDerivedId: entry.ID,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -482,7 +482,7 @@ func (ji *jiraImporter) ensureChange(repo *cache.RepoCache, b *cache.BugCache, e
|
|||||||
// changelog entry item as a separate git-bug operation.
|
// changelog entry item as a separate git-bug operation.
|
||||||
for idx, item := range entry.Items {
|
for idx, item := range entry.Items {
|
||||||
derivedID := getIndexDerivedID(entry.ID, idx)
|
derivedID := getIndexDerivedID(entry.ID, idx)
|
||||||
_, err := b.ResolveOperationWithMetadata(metaKeyJiraOperationId, derivedID)
|
_, err := b.ResolveOperationWithMetadata(metaKeyJiraDerivedId, derivedID)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
@ -502,8 +502,8 @@ func (ji *jiraImporter) ensureChange(repo *cache.RepoCache, b *cache.BugCache, e
|
|||||||
addedLabels,
|
addedLabels,
|
||||||
removedLabels,
|
removedLabels,
|
||||||
map[string]string{
|
map[string]string{
|
||||||
metaKeyJiraId: entry.ID,
|
metaKeyJiraId: entry.ID,
|
||||||
metaKeyJiraOperationId: derivedID,
|
metaKeyJiraDerivedId: derivedID,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -521,8 +521,8 @@ func (ji *jiraImporter) ensureChange(repo *cache.RepoCache, b *cache.BugCache, e
|
|||||||
author,
|
author,
|
||||||
entry.Created.Unix(),
|
entry.Created.Unix(),
|
||||||
map[string]string{
|
map[string]string{
|
||||||
metaKeyJiraId: entry.ID,
|
metaKeyJiraId: entry.ID,
|
||||||
metaKeyJiraOperationId: derivedID,
|
metaKeyJiraDerivedId: derivedID,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -535,8 +535,8 @@ func (ji *jiraImporter) ensureChange(repo *cache.RepoCache, b *cache.BugCache, e
|
|||||||
author,
|
author,
|
||||||
entry.Created.Unix(),
|
entry.Created.Unix(),
|
||||||
map[string]string{
|
map[string]string{
|
||||||
metaKeyJiraId: entry.ID,
|
metaKeyJiraId: entry.ID,
|
||||||
metaKeyJiraOperationId: derivedID,
|
metaKeyJiraDerivedId: derivedID,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -559,8 +559,8 @@ func (ji *jiraImporter) ensureChange(repo *cache.RepoCache, b *cache.BugCache, e
|
|||||||
entry.Created.Unix(),
|
entry.Created.Unix(),
|
||||||
string(item.ToString),
|
string(item.ToString),
|
||||||
map[string]string{
|
map[string]string{
|
||||||
metaKeyJiraId: entry.ID,
|
metaKeyJiraId: entry.ID,
|
||||||
metaKeyJiraOperationId: derivedID,
|
metaKeyJiraDerivedId: derivedID,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -577,8 +577,8 @@ func (ji *jiraImporter) ensureChange(repo *cache.RepoCache, b *cache.BugCache, e
|
|||||||
entry.Created.Unix(),
|
entry.Created.Unix(),
|
||||||
string(item.ToString),
|
string(item.ToString),
|
||||||
map[string]string{
|
map[string]string{
|
||||||
metaKeyJiraId: entry.ID,
|
metaKeyJiraId: entry.ID,
|
||||||
metaKeyJiraOperationId: derivedID,
|
metaKeyJiraDerivedId: derivedID,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -15,13 +15,13 @@ import (
|
|||||||
const (
|
const (
|
||||||
target = "jira"
|
target = "jira"
|
||||||
|
|
||||||
metaKeyJiraId = "jira-id"
|
metaKeyJiraId = "jira-id"
|
||||||
metaKeyJiraOperationId = "jira-derived-id"
|
metaKeyJiraDerivedId = "jira-derived-id"
|
||||||
metaKeyJiraKey = "jira-key"
|
metaKeyJiraKey = "jira-key"
|
||||||
metaKeyJiraUser = "jira-user"
|
metaKeyJiraUser = "jira-user"
|
||||||
metaKeyJiraProject = "jira-project"
|
metaKeyJiraProject = "jira-project"
|
||||||
metaKeyJiraExportTime = "jira-export-time"
|
metaKeyJiraExportTime = "jira-export-time"
|
||||||
metaKeyJiraLogin = "jira-login"
|
metaKeyJiraLogin = "jira-login"
|
||||||
|
|
||||||
confKeyBaseUrl = "base-url"
|
confKeyBaseUrl = "base-url"
|
||||||
confKeyProject = "project"
|
confKeyProject = "project"
|
||||||
|
Loading…
Reference in New Issue
Block a user