12:12 hello, is there any explaination of stacked branches besides the documentation? 12:13 the secion "using stacked branches" in the bzr manual doesn't explain it well, and many examples in it don't work 12:16 echo-area: those docs are the best I know of, but I'm happy to answer questions here 12:18 echo-area: the primary use case is pushing to a server where a trunk already exists (so most of your branch's revisions are already on the server), but you don't have write access to that repository 12:19 echo-area: so you can push (using the --stacked and --stacked-on options, or specially configure the remote .bzr directory) just the revisions unique to your branch to the server. 12:20 echo-area: launchpad for instance creates those specially configured .bzr directories automatically, so if I push a new branch to ~spiv/bzr/..., it will automatically be stacked on the bzr trunk. 12:31 echo-area: There are uses for branches that don't involve committing to them 12:32 echo-area: e.g. the scenario I described earlier (pushing to a server that has a suitable repository for stacking-on, but that you do not have permissions to write to) 13:39 spiv: I have not reproduced that scenario successfully yet. I did this: 13:39 bzr init-repo --no-trees test-repo 13:39 bzr init test-repo/trunk 13:39 bzr init-repo test-branch 13:40 bzr branch test-repo/trunk test-branch/trunk 13:41 cd test-branch/trunk <-- and work here, commit 13:42 then I did (in test-branch/trunk) bzr push --stacked ../../test-repo 13:43 I got messages like these: 13:43 Ignoring request for a stacked branch as repository already exists at the destination location. 13:43 All changes applied successfully. 13:43 Pushed up to revision 4. 13:44 but as I made another branch of test-repo/trunk, I didn't see the new revisions unique to test-branch/trunk 13:47 echo-area: that's not the scenario I was referring to 13:48 echo-area: because in that scenario you can (and did) push directly into the original repo (test-repo) 13:49 echo-area: I'm referring to a case like a server shared by several developers, but only one (or perhaps a non-human system account, like a gatekeeper bot) has access to the integration branch everyone branches off 13:50 spiv: should I make test-repo a stacked branch, and so that pushing onto it is the same as pushing to the stacked-on branch of test-repo? 13:50 echo-area: e.g. if the trunk is on /srv/project/trunk on a host, and /srv/project is a repo made with init-repo, but you don't have access to write to /srv/project 13:52 echo-area: but you can read from it, so you can do e.g. "bzr branch sftp://host/srv/project/trunk local-branch", work on that, and then push it up with "bzr push sftp://host/home/myuser/my-branch --stacked --stacked-on=sftp://host/home/myuser/my-branch" 13:53 echo-area: in that case making local-branch will still copy the full history, but you don't have to push the full history back to the server, you use stacking to point to the history the server already has 13:54 (and also you don't waste space on the server by keeping a second copy of the history) 15:23 spiv: please take a look at this, does it elaborate the scenario you mentioned: 15:23 bzr init-repo test-repo 15:23 bzr init test-repo/trunk 15:23 bzr init-repo stacked-repo 15:24 bzr branch --stacked test-repo/trunk stacked-repo/trunk 15:24 bzr init-repo local 15:24 bzr branch test-repo/trunk local/trunk 15:24 cd local/trunk <--- work here 15:24 echo-area: it doesn't make much sense to create a stacked branch in a shared repo (i.e. a directory you've made with init-repo) 15:25 (in local/trunk) bzr push ../../stacked-repo/trunk 15:26 spiv: so a stacked branch is better put in its own directory? 15:26 (I guess I can imagine uses for it, but it's certainly not how I would choose to explain it) 15:26 echo-area: I'd ignore init-repo entirely, really 15:27 echo-area: (for explaining how stacking works, not in general) 15:28 I'm not sure what you're asking, exactly. 15:29 I guess you're trying to test your understanding of stacking by constructing a scenario that uses it? 15:33 spiv: in your last example, "bzr push sftp://host/home/myuser/my-branch --stacked --stacked-on=sftp://host/home/myuser/my-branch", are the following statements true or not? 1) sftp://host/home/myuser/my-branch contains the full history too; 2) only the local revisions that have not been synced will be transfered during that push, the previous history will come from my-branch on host; and 3) full history will be tran 15:33 sfered in a normal push. 15:34 spiv: kind of. I want to figure out the things not explained explicitly in your example, hoping to help myself fully understand stacked branches 15:37 1) no, it only contains the history not in the stacked-on location (plus some small overhead), b) yes, only the history not already in sftp://host/home/myuser/my-branch and not already in its stacked-on location is pushed, 3) it depends; full history is transferred in a normal push when there is no shared repository (or that shared repository is empty or otherwise contains none of the relevant history) 15:38 spiv: so sftp://host/home/myuser/my-branch is a stacked branch too? 15:39 To clarify for 3, I mean a normal *initial* push. Obviously subsequent pushes to the same branch don't have to re-transfer data that was already transferred. 15:39 echo-area: what do you mean "too"? I think that's the only stacked branch in my example. 15:40 echo-area: oh, I see I made a silly typo in my example 15:40 echo-area: that command ought to have been "bzr push sftp://host/home/myuser/my-branch --stacked --stacked-on=sftp://host/srv/project/trunk" 15:40 echo-area: I guess that was rather confusing! 15:41 spiv: should be bzr push --stacked --stacked-on=sftp://host/srv/project/trunk sftp://host/myuser/myproject, right? 15:42 echo-area: right 15:42 spiv: whoa, I think I understand that now. Thank you!