rename to 'Namespace'
This commit is contained in:
parent
eb9dea5dd0
commit
b83a5d491f
2
doGui.go
2
doGui.go
|
@ -191,7 +191,7 @@ func drawWindow(win *gadgets.GenericWindow) {
|
||||||
|
|
||||||
for patch := range notdone.IterAll() {
|
for patch := range notdone.IterAll() {
|
||||||
comment := cleanSubject(patch.Comment)
|
comment := cleanSubject(patch.Comment)
|
||||||
log.Info("new patch:", patch.NewHash, "commithash:", patch.CommitHash, patch.RepoNamespace, comment)
|
log.Info("new patch:", patch.NewHash, "commithash:", patch.CommitHash, patch.Namespace, comment)
|
||||||
}
|
}
|
||||||
// savePatchsets()
|
// savePatchsets()
|
||||||
patchesWin = makePatchesWin(notdone)
|
patchesWin = makePatchesWin(notdone)
|
||||||
|
|
|
@ -51,7 +51,7 @@ func makePatchesWin(patches *forgepb.Patches) *stdPatchTableWin {
|
||||||
all := patches.All()
|
all := patches.All()
|
||||||
for all.Scan() {
|
for all.Scan() {
|
||||||
patch := all.Next()
|
patch := all.Next()
|
||||||
repomap[patch.RepoNamespace] += 1
|
repomap[patch.Namespace] += 1
|
||||||
}
|
}
|
||||||
grid.NewLabel(fmt.Sprintf("%d", len(repomap)))
|
grid.NewLabel(fmt.Sprintf("%d", len(repomap)))
|
||||||
grid.NewLabel(fmt.Sprintf("total repos"))
|
grid.NewLabel(fmt.Sprintf("total repos"))
|
||||||
|
@ -72,7 +72,7 @@ func makePatchesWin(patches *forgepb.Patches) *stdPatchTableWin {
|
||||||
|
|
||||||
for patch := range notdone.IterAll() {
|
for patch := range notdone.IterAll() {
|
||||||
comment := cleanSubject(patch.Comment)
|
comment := cleanSubject(patch.Comment)
|
||||||
log.Info("new patch:", patch.NewHash, "commithash:", patch.CommitHash, patch.RepoNamespace, comment)
|
log.Info("new patch:", patch.NewHash, "commithash:", patch.CommitHash, patch.Namespace, comment)
|
||||||
}
|
}
|
||||||
dwin.doPatchesTable(notdone)
|
dwin.doPatchesTable(notdone)
|
||||||
})
|
})
|
||||||
|
@ -81,7 +81,7 @@ func makePatchesWin(patches *forgepb.Patches) *stdPatchTableWin {
|
||||||
all := patches.SortByFilename()
|
all := patches.SortByFilename()
|
||||||
for all.Scan() {
|
for all.Scan() {
|
||||||
p := all.Next()
|
p := all.Next()
|
||||||
rn := p.RepoNamespace
|
rn := p.Namespace
|
||||||
repo := me.forge.FindByGoPath(rn)
|
repo := me.forge.FindByGoPath(rn)
|
||||||
if repo == nil {
|
if repo == nil {
|
||||||
log.Info("Could not figure out repo path", rn)
|
log.Info("Could not figure out repo path", rn)
|
||||||
|
@ -114,7 +114,7 @@ func makePatchesWin(patches *forgepb.Patches) *stdPatchTableWin {
|
||||||
}
|
}
|
||||||
|
|
||||||
func applyPatchNew(p *forgepb.Patch) error {
|
func applyPatchNew(p *forgepb.Patch) error {
|
||||||
rn := p.RepoNamespace
|
rn := p.Namespace
|
||||||
repo := me.forge.FindByGoPath(rn)
|
repo := me.forge.FindByGoPath(rn)
|
||||||
if repo == nil {
|
if repo == nil {
|
||||||
return fmt.Errorf("Could not figure out repo path %s", rn)
|
return fmt.Errorf("Could not figure out repo path %s", rn)
|
||||||
|
@ -156,7 +156,7 @@ func AddPatchesPB(tbox *gui.Node, pb *forgepb.Patches) *forgepb.PatchesTable {
|
||||||
t.SetParent(tbox)
|
t.SetParent(tbox)
|
||||||
|
|
||||||
gitam := t.AddButtonFunc("apply", func(p *forgepb.Patch) string {
|
gitam := t.AddButtonFunc("apply", func(p *forgepb.Patch) string {
|
||||||
rn := p.RepoNamespace
|
rn := p.Namespace
|
||||||
if repo := me.forge.FindByGoPath(rn); repo == nil {
|
if repo := me.forge.FindByGoPath(rn); repo == nil {
|
||||||
// log.Info("Could not figure out repo path", rn)
|
// log.Info("Could not figure out repo path", rn)
|
||||||
return ""
|
return ""
|
||||||
|
@ -172,7 +172,7 @@ func AddPatchesPB(tbox *gui.Node, pb *forgepb.Patches) *forgepb.PatchesTable {
|
||||||
}
|
}
|
||||||
|
|
||||||
t.AddCommitHash()
|
t.AddCommitHash()
|
||||||
t.AddRepoNamespace()
|
t.AddNamespace()
|
||||||
// t.AddFilename()
|
// t.AddFilename()
|
||||||
t.AddStringFunc("file", func(p *forgepb.Patch) string {
|
t.AddStringFunc("file", func(p *forgepb.Patch) string {
|
||||||
_, fname := filepath.Split(p.Filename)
|
_, fname := filepath.Split(p.Filename)
|
||||||
|
|
|
@ -150,7 +150,7 @@ func makePatchsetsWin() *stdPatchsetTableWin {
|
||||||
|
|
||||||
for patch := range notdone.IterAll() {
|
for patch := range notdone.IterAll() {
|
||||||
comment := cleanSubject(patch.Comment)
|
comment := cleanSubject(patch.Comment)
|
||||||
log.Info("new patch:", patch.NewHash, "commithash:", patch.CommitHash, patch.RepoNamespace, comment)
|
log.Info("new patch:", patch.NewHash, "commithash:", patch.CommitHash, patch.Namespace, comment)
|
||||||
}
|
}
|
||||||
// savePatchsets()
|
// savePatchsets()
|
||||||
makePatchesWin(notdone)
|
makePatchesWin(notdone)
|
||||||
|
@ -263,10 +263,10 @@ func setPatchsetState(p *forgepb.Patchset) {
|
||||||
all := p.Patches.All()
|
all := p.Patches.All()
|
||||||
for all.Scan() {
|
for all.Scan() {
|
||||||
patch := all.Next()
|
patch := all.Next()
|
||||||
// log.Info("patch:", patch.StartHash, patch.CommitHash, patch.RepoNamespace, patch.Filename)
|
// log.Info("patch:", patch.StartHash, patch.CommitHash, patch.Namespace, patch.Filename)
|
||||||
repo := me.forge.FindByGoPath(patch.RepoNamespace)
|
repo := me.forge.FindByGoPath(patch.Namespace)
|
||||||
if repo == nil {
|
if repo == nil {
|
||||||
log.Info("could not find repo", patch.RepoNamespace)
|
log.Info("could not find repo", patch.Namespace)
|
||||||
bad = true
|
bad = true
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@ -278,11 +278,11 @@ func setPatchsetState(p *forgepb.Patchset) {
|
||||||
}
|
}
|
||||||
if name, err := repo.GetHashName(patch.StartHash); err == nil {
|
if name, err := repo.GetHashName(patch.StartHash); err == nil {
|
||||||
// it might be possible to apply this patch
|
// it might be possible to apply this patch
|
||||||
log.Info("patch may be good:", patch.RepoNamespace, name, patch.CommitHash, patch.Filename)
|
log.Info("patch may be good:", patch.Namespace, name, patch.CommitHash, patch.Filename)
|
||||||
good = true
|
good = true
|
||||||
} else {
|
} else {
|
||||||
// probably screwed up git trees
|
// probably screwed up git trees
|
||||||
log.Info("patch with unknown origin:", patch.RepoNamespace, name, err, patch.CommitHash, patch.Filename)
|
log.Info("patch with unknown origin:", patch.Namespace, name, err, patch.CommitHash, patch.Filename)
|
||||||
bad = true
|
bad = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -351,27 +351,27 @@ func setNewCommitHash(p *forgepb.Patchset) bool {
|
||||||
for patch := range p.Patches.IterAll() {
|
for patch := range p.Patches.IterAll() {
|
||||||
// parts := strings.Fields(patch.Comment)
|
// parts := strings.Fields(patch.Comment)
|
||||||
|
|
||||||
repo := me.forge.FindByGoPath(patch.RepoNamespace)
|
repo := me.forge.FindByGoPath(patch.Namespace)
|
||||||
if repo == nil {
|
if repo == nil {
|
||||||
log.Info("could not find repo", patch.RepoNamespace)
|
log.Info("could not find repo", patch.Namespace)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
comment := cleanSubject(patch.Comment)
|
comment := cleanSubject(patch.Comment)
|
||||||
|
|
||||||
if patch.NewHash != "na" {
|
if patch.NewHash != "na" {
|
||||||
log.Info("patch: newhash:", patch.NewHash, "commithash:", patch.CommitHash, patch.RepoNamespace, comment)
|
log.Info("patch: newhash:", patch.NewHash, "commithash:", patch.CommitHash, patch.Namespace, comment)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
done = false
|
done = false
|
||||||
os.Chdir(repo.GetFullPath())
|
os.Chdir(repo.GetFullPath())
|
||||||
newhash, err := findCommitBySubject(comment)
|
newhash, err := findCommitBySubject(comment)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Info("patch: not found hash:", patch.CommitHash, patch.RepoNamespace, comment, newhash, err)
|
log.Info("patch: not found hash:", patch.CommitHash, patch.Namespace, comment, newhash, err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
patch.NewHash = newhash
|
patch.NewHash = newhash
|
||||||
log.Info("patch: found hash:", patch.CommitHash, newhash, patch.RepoNamespace, comment)
|
log.Info("patch: found hash:", patch.CommitHash, newhash, patch.Namespace, comment)
|
||||||
}
|
}
|
||||||
|
|
||||||
return done
|
return done
|
||||||
|
@ -382,13 +382,13 @@ func AddNotDonePatches(notdone *forgepb.Patches, pset *forgepb.Patchset, full bo
|
||||||
comment := cleanSubject(patch.Comment)
|
comment := cleanSubject(patch.Comment)
|
||||||
|
|
||||||
if found := notdone.FindByCommitHash(patch.CommitHash); found != nil {
|
if found := notdone.FindByCommitHash(patch.CommitHash); found != nil {
|
||||||
log.Info("duplicate notdone", patch.RepoNamespace, "patch:", patch.NewHash, "commithash:", patch.CommitHash, comment)
|
log.Info("duplicate notdone", patch.Namespace, "patch:", patch.NewHash, "commithash:", patch.CommitHash, comment)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
repo := me.forge.FindByGoPath(patch.RepoNamespace)
|
repo := me.forge.FindByGoPath(patch.Namespace)
|
||||||
if repo == nil {
|
if repo == nil {
|
||||||
log.Info("could not find repo", patch.RepoNamespace)
|
log.Info("could not find repo", patch.Namespace)
|
||||||
if full {
|
if full {
|
||||||
notdone.AppendByCommitHash(patch) // double check to ensure the commit hash isn't added twice
|
notdone.AppendByCommitHash(patch) // double check to ensure the commit hash isn't added twice
|
||||||
}
|
}
|
||||||
|
@ -396,14 +396,14 @@ func AddNotDonePatches(notdone *forgepb.Patches, pset *forgepb.Patchset, full bo
|
||||||
}
|
}
|
||||||
|
|
||||||
if patch.NewHash != "na" {
|
if patch.NewHash != "na" {
|
||||||
log.Info("already applied patch", patch.RepoNamespace, ": newhash:", patch.NewHash, "commithash:", patch.CommitHash, comment)
|
log.Info("already applied patch", patch.Namespace, ": newhash:", patch.NewHash, "commithash:", patch.CommitHash, comment)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
os.Chdir(repo.GetFullPath())
|
os.Chdir(repo.GetFullPath())
|
||||||
newhash, err := findCommitByHash(patch.StartHash, comment)
|
newhash, err := findCommitByHash(patch.StartHash, comment)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// this patch has not been applied yet
|
// this patch has not been applied yet
|
||||||
log.Info("patch: not found hash:", patch.RepoNamespace, patch.CommitHash, comment, err)
|
log.Info("patch: not found hash:", patch.Namespace, patch.CommitHash, comment, err)
|
||||||
notdone.AppendByCommitHash(patch) // double check to ensure the commit hash isn't added twice
|
notdone.AppendByCommitHash(patch) // double check to ensure the commit hash isn't added twice
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@ -411,12 +411,12 @@ func AddNotDonePatches(notdone *forgepb.Patches, pset *forgepb.Patchset, full bo
|
||||||
newhash, err = findCommitBySubject(comment)
|
newhash, err = findCommitBySubject(comment)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
patch.NewHash = newhash
|
patch.NewHash = newhash
|
||||||
log.Info("patch: found hash:", patch.RepoNamespace, "commit patch", patch.CommitHash, "new hash", newhash, "start hash", patch.StartHash, comment)
|
log.Info("patch: found hash:", patch.Namespace, "commit patch", patch.CommitHash, "new hash", newhash, "start hash", patch.StartHash, comment)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
// this patch has not been applied yet
|
// this patch has not been applied yet
|
||||||
log.Info("patch: not found hash:", patch.RepoNamespace, patch.CommitHash, comment, newhash, err)
|
log.Info("patch: not found hash:", patch.Namespace, patch.CommitHash, comment, newhash, err)
|
||||||
notdone.AppendByCommitHash(patch) // double check to ensure the commit hash isn't added twice
|
notdone.AppendByCommitHash(patch) // double check to ensure the commit hash isn't added twice
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -117,7 +117,7 @@ func (r *repoPatchWindow) addPatchset(grid *gui.Node, pset *forgepb.Patchset) {
|
||||||
all := pset.Patches.SortByFilename()
|
all := pset.Patches.SortByFilename()
|
||||||
for all.Scan() {
|
for all.Scan() {
|
||||||
p := all.Next()
|
p := all.Next()
|
||||||
s := p.RepoNamespace
|
s := p.Namespace
|
||||||
repo := me.forge.FindByGoPath(s)
|
repo := me.forge.FindByGoPath(s)
|
||||||
if repo == nil {
|
if repo == nil {
|
||||||
log.Info("COULD NOT FIND", s)
|
log.Info("COULD NOT FIND", s)
|
||||||
|
|
Loading…
Reference in New Issue