[18:21] <LeoNerd> would an argument called  bzr update --fail-if-diverged  really be so much to ask for?
[18:21] <LeoNerd> I keep getting upset that 'bzr up' causes pending merges on divergant history. I _never_ want merges. If the history has diverged I want to rebase it because that implies I Have Messed Up
[18:22] <mgz> why not just use pull then?
[18:22] <LeoNerd> Because in 99.999% of cases 'up' is what I want
[18:23] <LeoNerd> It's only that one-time-in-almost-never case that they have divergant history in the first place
[23:16] <achiang> hello, what is the incantation to make bzr to branch from LP, but use as many bits from my local repo as possible?
[23:16] <achiang> i am finding the help for `bzr branch` to be slightly hard to comprehend
[23:17] <achiang> use case is: large branch in LP, slow network, want to grab something that hasn't been merged yet, and i have a local copy of trunk
[23:17] <fullermd> There is no invocation, that's just how it works.
[23:17] <fullermd> Assuming you _have_ a local repo, anyway.
[23:19] <achiang> fullermd: hm, i should explain more... i do a bzr branch lp:~colleague/project/branch and it is grabbing a lot of data over the network
[23:19] <achiang> but i also have a ./trunk/ locally on my disk
[23:19] <achiang> i'm not sure how to grab ~colleague/project/branch without downloading everything...
[23:28] <achiang> fullermd: should i just `bzr branch ./trunk foo` and then inside foo/ do `bzr pull lp:~colleague/project/branch` ?
[23:35] <fullermd> Well, that would be one way.  But a better way would just be to make a repo.
[23:40] <achiang> i'm reading through http://wiki.bazaar.canonical.com/SharedRepositoryTutorial and i don't get how to combine a local repo with remote branches
[23:41] <mgrandi> if you just create a shared repository
[23:41] <mgrandi> every branch inside that shared repo will share the commit data
[23:41] <fullermd> There's no real "combining".  A repo is a purely local construct, all your interaction with remotes remains at the branch level.
[23:41] <fullermd> So you'd just have both trunk and foo inside a repo locally.
[23:41] <mgrandi> so if you have two branches that have diverged, say, 12 commits, but the first 10 are the same, then it will store 14 commits, and share the first 10, while storing the unique 4 when they diverged
[23:42] <achiang> so create a local repo, then bzr branch "remote" and the branch command will try to use as many objects from the local repo as possible, and download the rest from the remote?
[23:42] <mgrandi> i assume so
[23:42] <fullermd> Well, you'd need the step of "change local trunk so it uses the repo" to get the objects into it.
[23:43] <fullermd> But that aside, yes.
[23:43] <mgrandi> wouldn't just branching into the shared repoistory do that?
[23:43] <fullermd> I'd presume he'd just make the repo around the current location.
[23:43] <mgrandi> ah
[23:43] <mgrandi> you would have to repack it
[23:43] <fullermd> Wouldn't do anything.
[23:43] <fullermd> You'd need reconfigure --use-shared (I think that's what it's called; xref docs)
[23:44] <mgrandi> doesn't it figure out that there is now a shared repo and put the pack in the shared repo rather then the local branch .bzr file?
[23:44] <fullermd> No, it's perfectly reasonable to have a standalone branch located inside but not using a shared repo.
[23:44] <mgrandi> interesting
[23:45]  * achiang studies http://stackoverflow.com/questions/6500282/can-i-take-a-bazaar-branch-and-make-it-my-main-shared-repository
[23:45] <fullermd> It's not majorly different from having one branch stuck inside another, after all.
[23:46] <mgrandi> for that stack overflow post, to create a new shared repo with 'only' the objects that the branches you want inside it are using
[23:46] <mgrandi> just create a shared repo, then branch the ..branches into it and it will get the stuff it needs
[23:46] <mgrandi> don't bother with copying the .bzr directory as bazaar does the work for you!
[23:47]  * achiang thinks the 2nd answer looks interesting
[23:47] <achiang> the one calling bzr reconfigure
[23:47] <mgrandi> i think thats too much work
[23:48] <mgrandi> say you have branchA and branchB, you want to put inside a shared repo
[23:48] <mgrandi> cd shared_repo
[23:48] <fullermd> branching the branches in would require resetting all the per-branch config (like parent locations).
[23:48] <fullermd> IT's easier to just do it in place.
[23:48] <mgrandi> bzr init-repo --no-trees.
[23:48] <mgrandi> (space before the dot)
[23:48] <mgrandi> then just bzr branch branchA and bzr branch branchB
[23:49] <mgrandi> it will branch the old branches that you want to convert, make them used the shared repo automatically and only copy the objects it needs
[23:49] <fullermd> Much simpler to start from ~/work/whatever/trunk and just do bzr init-repo ~/work/whatever ; bzr reconfig --use-shared ~/work/whatever/trunk
[23:50] <mgrandi> or that
[23:50] <mgrandi> depends on how the folder structure is set up, and you arn't creating a repo in some random directory with other stuff in it
[23:51] <fullermd> Well, you can just mv the branch wholesale to some new place if things are too cluttered already.
[23:51] <achiang> fullermd: thanks, i just did that: cd trunk ; bzr init-repo ../ ; bzr reconfigure --use-shared
[23:51] <fullermd> But that's independent of the repo step, and you should do that anyway   ;)
[23:51] <achiang> then i did cd .. ; bzr branch lp:~colleague/project/branch and it was super-fast
[23:51] <achiang> so thanks!
[23:51] <fullermd> Eggselent.
[23:52] <mgrandi> this reminds me when i was trying to figure out how best to 'archive' a bzr repo, as someone told me the .bzr folder might not be the best thing to transfer across filesystems and whatnot
[23:53] <mgrandi> the solution i found on SO was to create a new repo and then do a email merge request for the entire branch and have that saved as a file, seems a bit hackish but it works
[23:54] <jelmer> mgrandi: what would be wrong with the .bzr directory?
[23:54] <jelmer> the only thing I can think of is that if your backup actually does go bad that it's easier to recover from an email merge request by hand
[23:55] <mgrandi> i dunno, someone mentioned that it 'could' be not the most portable thing if you are creating a branch on windows, copy to linux or mac or whatever
[23:55] <fullermd> Grabbing a .bzr of just a branch might miss all the repo stuff if it's using one, grabbing the .bzr of a repo won't get any of the branches in it...
[23:55] <mgrandi> on the website, it says the best 'backup' of a bzr repo is to use bzr itself, but that doesn't really lend itself to like, saving it as an archive or something
[23:56] <jelmer> mgrandi: what fullermd says, you have to make sure you backup all the relevant .bzr directories
[23:56] <jelmer> mgrandi: but there are no portability issues
[23:56] <mgrandi> only one i can think of is if there is any OS specific stuff to a checkout, like symlinks maybe?
[23:57] <fullermd> The simplest way to back up a _repo_ would be to just tar the whole thing up.  For a _branch_, just 'branch' it somewhere temporary and tar that up.
[23:57] <jelmer> mgrandi: there are no symlinks under .bzr/
[23:58] <mgrandi> yeah, but the checkout of the branch could have them or something
[23:58] <mgrandi> but you are probably right that the .bzr format is fine to just tar up and save somewhere
[23:58] <jelmer> mgrandi: you're not including those, that's why you're backing up just .bzr/
[23:59] <mgrandi> ah
[23:59] <mgrandi> http://stackoverflow.com/questions/1976857/bzr-create-tgz-file-containing-full-repository is what i was referring to
[23:59] <fullermd> The alternate answer is "use git-bzr or something to turn it into a git repo, then create a new email account, use git-send-email to dump an endless stream of patches into it, then just carry the mbox around"  ;)