add --sync-suffic

Description

20:06 < pipping> i've made a modification to your workflow for me (read: i made it suck)
20:07 < pipping> by default i want `cave sync` to use the online versions of the repositories
20:07 < pipping> i only want cave to use my local copies when i'm testing a package
20:08 < pipping> so my desktop.conf e.g. has two lines aside from location = :
20:08 < pipping> #sync = git://git.exherbo.org/desktop.git
20:08 < pipping> sync = git+file:///home/pipping/Documents/Code/checkouts/desktop
20:08 < pipping> i have two scripts, couple.sh and decouple.sh
20:09 < pipping> here's decouple.sh: http://dpaste.com/271506/plain/
20:09 < pipping> couple.sh is just a symlink to that script
20:09 < pipping> whenever i want paludis to use my local copy, i run "couple.sh"
20:09 < pipping> when i'm done, i run "decouple.sh"
20:11 < pipping> decouple.sh makes sure the '#' is in front of the line with git+file://
20:11 < pipping> couple.sh makes sure the '#' is in front of the line with git://
20:27 < ciaranm> there should probably be a better way of doing that
20:28 < ciaranm> maybe allowing repos to define sync = blah ; sync.local = blah and then doing cave sync
--sync-suffix local
20:29 < ciaranm> if you want it, work it out and ticket it
20:33 < pipping> that sounds pretty good
[..]
20:39 < pipping> ciaranm: what more needs working out w.r.t --sync-suffix local on top of what you just mentioned?
20:39 < pipping> ciaranm: because it already sounds perfect
20:40 < ciaranm> pipping: what happens if your repo doesn't define a sync.thingyousaid
20:40 < pipping> error!
20:40 < ciaranm> does it not sync it? fall back to using sync = ? fall back to using sync = , but only if that repo
doesn't define any sync.* things?
20:40 < ciaranm> so you'd have to define sync.local in every single syncable repo, even those you don't use locally?
20:40 < pipping> oh
20:41 < pipping> well i only meant to use it like 'cs --ss l arbor'
20:41 < pipping> not 'cs --ss l'
20:41 < pipping> i guess having it fall back to the default makes sense
20:42 < ciaranm> fall back to the default, or fall back to the default only if no sync.* things exist for that repo?
20:42 < pipping> i guess that needs more thought indeed
20:44 < ciaranm> also more pens
20:44 * ciaranm gigglse
20:52 < ciaranm> pipping: ticket!

Change History

i would not expect it to fall back to default sync if i wanted to sync all locals. Actually i don't see that being used a lot. Why would you be syncing more than max a couple of repos locally at the same time?

I say it should only sync the suffix it's told to sync, so don't do anything if there is no sync.local in a repo

Minor annoyance: we don't support iterating over all possible keys to the repo factory ctor, so there's no way of getting a list of all sync.blah keys. We could change the API to allow this (which is a bit messy), or we could go with something like: