Merge lp:~sergiusens/snapweb/sortResults into lp:~snappy-dev/snapweb/trunk

Proposed by Sergio Schvezov
Status: Merged
Approved by: John Lenton
Approved revision: 116
Merged at revision: 116
Proposed branch: lp:~sergiusens/snapweb/sortResults
Merge into: lp:~snappy-dev/snapweb/trunk
Diff against target: 64 lines (+3/-5)
2 files modified
snappy/converge.go (+3/-0)
snappy/converge_test.go (+0/-5)
To merge this branch: bzr merge lp:~sergiusens/snapweb/sortResults
Reviewer Review Type Date Requested Status
John Lenton (community) Approve
Review via email: mp+258375@code.launchpad.net

Commit message

Return an ordered list of packages.

To post a comment you must log in.
Revision history for this message
John Lenton (chipaca) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'snappy/converge.go'
2--- snappy/converge.go 2015-05-05 22:49:07 +0000
3+++ snappy/converge.go 2015-05-06 12:51:43 +0000
4@@ -18,6 +18,7 @@
5 package snappy
6
7 import (
8+ "sort"
9 "strconv"
10 "strings"
11
12@@ -153,6 +154,8 @@
13 snapPkgs = append(snapPkgs, *v)
14 }
15
16+ sort.Sort(snapPkgsByName(snapPkgs))
17+
18 return snapPkgs
19 }
20
21
22=== modified file 'snappy/converge_test.go'
23--- snappy/converge_test.go 2015-05-05 22:49:07 +0000
24+++ snappy/converge_test.go 2015-05-06 12:51:43 +0000
25@@ -21,7 +21,6 @@
26 "io/ioutil"
27 "os"
28 "path/filepath"
29- "sort"
30
31 . "gopkg.in/check.v1"
32 "launchpad.net/snappy/snappy"
33@@ -134,7 +133,6 @@
34 }
35
36 snaps := mergeSnaps(installed, nil, true)
37- sort.Sort(snapPkgsByName(snaps))
38
39 c.Assert(snaps, HasLen, 3)
40 c.Assert(snaps[0].Name, Equals, "app1.canonical")
41@@ -165,7 +163,6 @@
42
43 // Only installed
44 snaps := mergeSnaps(installed, remotes, true)
45- sort.Sort(snapPkgsByName(snaps))
46
47 c.Assert(snaps, HasLen, 3)
48 c.Check(snaps[0].Name, Equals, "app1.canonical")
49@@ -188,7 +185,6 @@
50
51 // Installed and remotes
52 snaps = mergeSnaps(installed, remotes, false)
53- sort.Sort(snapPkgsByName(snaps))
54
55 c.Assert(snaps, HasLen, 4)
56 c.Check(snaps[0].Name, Equals, "app1.canonical")
57@@ -233,7 +229,6 @@
58
59 // Installed and remotes
60 snaps := mergeSnaps(installed, remotes, false)
61- sort.Sort(snapPkgsByName(snaps))
62
63 c.Assert(snaps, HasLen, 5)
64 c.Check(snaps[0].Name, Equals, "app1.canonical")

Subscribers

People subscribed via source and target branches