"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/cmd/go/internal/modload/query.go" between
go1.19.src.tar.gz and go1.19.1.src.tar.gz

About: Google’s Go is a compiled, garbage-collected, concurrent programming language.
Latest stable release (1.19).

query.go  (go1.19.src):query.go  (go1.19.1.src)
skipping to change at line 223 skipping to change at line 223
if err != nil { if err != nil {
return nil, err return nil, err
} }
revErr := &modfetch.RevInfo{Origin: versions.Origin} // RevInfo to return with error revErr := &modfetch.RevInfo{Origin: versions.Origin} // RevInfo to return with error
releases, prereleases, err := qm.filterVersions(ctx, versions.List) releases, prereleases, err := qm.filterVersions(ctx, versions.List)
if err != nil { if err != nil {
return revErr, err return revErr, err
} }
mergeRevOrigin := func(rev *modfetch.RevInfo, origin *codehost.Origin) *m
odfetch.RevInfo {
merged := mergeOrigin(rev.Origin, origin)
if merged == rev.Origin {
return rev
}
clone := new(modfetch.RevInfo)
*clone = *rev
clone.Origin = merged
return clone
}
lookup := func(v string) (*modfetch.RevInfo, error) { lookup := func(v string) (*modfetch.RevInfo, error) {
rev, err := repo.Stat(v) rev, err := repo.Stat(v)
// Stat can return a non-nil rev and a non-nil err, // Stat can return a non-nil rev and a non-nil err,
// in order to provide origin information to make the error cache able. // in order to provide origin information to make the error cache able.
if rev == nil && err != nil { if rev == nil && err != nil {
return revErr, err return revErr, err
} }
rev.Origin = mergeOrigin(rev.Origin, versions.Origin) rev = mergeRevOrigin(rev, versions.Origin)
if err != nil { if err != nil {
return rev, err return rev, err
} }
if (query == "upgrade" || query == "patch") && module.IsPseudoVer sion(current) && !rev.Time.IsZero() { if (query == "upgrade" || query == "patch") && module.IsPseudoVer sion(current) && !rev.Time.IsZero() {
// Don't allow "upgrade" or "patch" to move from a pseudo -version // Don't allow "upgrade" or "patch" to move from a pseudo -version
// to a chronologically older version or pseudo-version. // to a chronologically older version or pseudo-version.
// //
// If the current version is a pseudo-version from an unt agged branch, it // If the current version is a pseudo-version from an unt agged branch, it
// may be semantically lower than the "latest" release or the latest // may be semantically lower than the "latest" release or the latest
skipping to change at line 259 skipping to change at line 270
// information. (For example, v1.0.1 might be a backport of a fix already // information. (For example, v1.0.1 might be a backport of a fix already
// incorporated into v1.1.0, in which case v1.0.1 would b e chronologically // incorporated into v1.1.0, in which case v1.0.1 would b e chronologically
// newer but v1.1.0 is still an “upgrade”; or v1.0.2 migh t be a revert of // newer but v1.1.0 is still an “upgrade”; or v1.0.2 migh t be a revert of
// an unsuccessful fix in v1.0.1, in which case the v1.0. 2 commit may be // an unsuccessful fix in v1.0.1, in which case the v1.0. 2 commit may be
// older than the v1.0.1 commit despite the tag itself be ing newer.) // older than the v1.0.1 commit despite the tag itself be ing newer.)
currentTime, err := module.PseudoVersionTime(current) currentTime, err := module.PseudoVersionTime(current)
if err == nil && rev.Time.Before(currentTime) { if err == nil && rev.Time.Before(currentTime) {
if err := allowed(ctx, module.Version{Path: path, Version: current}); errors.Is(err, ErrDisallowed) { if err := allowed(ctx, module.Version{Path: path, Version: current}); errors.Is(err, ErrDisallowed) {
return revErr, err return revErr, err
} }
info, err := repo.Stat(current) rev, err = repo.Stat(current)
if info == nil && err != nil { if rev == nil && err != nil {
return revErr, err return revErr, err
} }
info.Origin = mergeOrigin(info.Origin, versions.O rev = mergeRevOrigin(rev, versions.Origin)
rigin) return rev, err
return info, err
} }
} }
return rev, nil return rev, nil
} }
if qm.preferLower { if qm.preferLower {
if len(releases) > 0 { if len(releases) > 0 {
return lookup(releases[0]) return lookup(releases[0])
} }
 End of changes. 4 change blocks. 
6 lines changed or deleted 17 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)