Rename noms-pull -> shove, and fix shove

I busted noms-pull in the patch where I added MaybeHeads. So,
fix it and rename to 'shove' per issue #210
This commit is contained in:
Chris Masone
2015-08-24 16:56:45 -07:00
parent 53f2b6a08e
commit 9a9d5a98e6
3 changed files with 9 additions and 4 deletions
-1
View File
@@ -1 +0,0 @@
noms-pull
+1
View File
@@ -0,0 +1 @@
shove
@@ -7,6 +7,7 @@ import (
"github.com/attic-labs/noms/clients/util"
"github.com/attic-labs/noms/d"
"github.com/attic-labs/noms/dataset"
"github.com/attic-labs/noms/ref"
"github.com/attic-labs/noms/sync"
)
@@ -30,10 +31,14 @@ func main() {
defer util.StopCPUProfile()
}
newHead := source.Head().Ref()
refs := sync.DiffHeadsByRef(sink.Head().Ref(), newHead, source.Store())
newHeadRef := source.Head().Ref()
currentHeadRef := ref.Ref{}
if currentHead, ok := sink.MaybeHead(); ok {
currentHeadRef = currentHead.Ref()
}
refs := sync.DiffHeadsByRef(currentHeadRef, newHeadRef, source.Store())
sync.CopyChunks(refs, source.Store(), sink.Store())
for ok := false; !ok; *sink, ok = sync.SetNewHead(newHead, *sink) {
for ok := false; !ok; *sink, ok = sync.SetNewHead(newHeadRef, *sink) {
continue
}