dump out PatchId info
This commit is contained in:
parent
fc9b0a69a8
commit
174289d3db
33
doClean.go
33
doClean.go
|
@ -272,10 +272,39 @@ func checkRemoteBranches(repo *gitpb.Repo) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func checkPatchIds(repo *gitpb.Repo, b1 string, b2 string) error {
|
func checkPatchIds(repo *gitpb.Repo, b1 string, b2 string) error {
|
||||||
|
ids := make(map[string]string)
|
||||||
s1 := fmt.Sprintf("%s..%s", b1, b2)
|
s1 := fmt.Sprintf("%s..%s", b1, b2)
|
||||||
s2 := fmt.Sprintf("%s..%s", b2, b1)
|
s2 := fmt.Sprintf("%s..%s", b2, b1)
|
||||||
repo.RunVerbose([]string{"git", "rev-list", s1})
|
if stats, err := repo.RunStrict([]string{"git", "rev-list", s1}); err != nil {
|
||||||
repo.RunVerbose([]string{"git", "rev-list", s2})
|
return err
|
||||||
|
} else {
|
||||||
|
for _, hash := range stats.Stdout {
|
||||||
|
patchId, err := repo.FindPatchId(hash)
|
||||||
|
if err != nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
ids[patchId] = hash
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if stats, err := repo.RunStrict([]string{"git", "rev-list", s2}); err != nil {
|
||||||
|
return err
|
||||||
|
} else {
|
||||||
|
for _, hash := range stats.Stdout {
|
||||||
|
patchId, err := repo.FindPatchId(hash)
|
||||||
|
if err != nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if _, ok := ids[patchId]; ok {
|
||||||
|
log.Info("already here")
|
||||||
|
} else {
|
||||||
|
ids[patchId] = hash
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for key, val := range ids {
|
||||||
|
log.Info(key, val)
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue