Push creates a directory and .bzr but uploads none of my code files

Asked by Jon Loldrup

I'm trying to create a central repository for using bazaar with the "Team collaboration, distributed style" (see http://doc.bazaar.canonical.com/bzr.2.2/en/user-guide/index.html ) setup.

I realize that to initiate my central repository I have to follow this guide:
http://doc.bazaar.canonical.com/bzr.2.2/en/user-guide/publishing_a_branch.html
(though this guide is nested in the "Team collaboration, central style" part of the User Guide)

I have tried both the first suggestion and the second suggestion under the "Starting a central branch" headline:

Suggestion 1: Making a local branch and pushing it to a central location:
At my home computer I do:

bzr init-repo bachelorprojekt
Shared repository with trees (format: 2a)
Location:
  shared repository: bachelorprojekt
loldrup@explab:~/dirdiffsim$ bzr init bachelorprojekt/trunk
Created a repository tree (format: 2a)
Using shared repository: /home/loldrup/dirdiffsim/bachelorprojekt/
loldrup@explab:~/dirdiffsim$ cd bachelorprojekt/trunk/
loldrup@explab:~/dirdiffsim/bachelorprojekt/trunk$ vi hello.py
loldrup@explab:~/dirdiffsim/bachelorprojekt/trunk$ bzr add
adding hello.py
loldrup@explab:~/dirdiffsim/bachelorprojekt/trunk$ bzr commit -m "hello world"
Committing to: /dirdiffsim/bachelorprojekt/trunk/
added hello.py
Committed revision 1.
loldrup@explab:~/dirdiffsim/bachelorprojekt/trunk$ bzr push sftp://brok.diku.dk/usr/local/projects/disk07/dirdiffsim/bachelorprojekt/trunk
<email address hidden>'s password:
bzr: ERROR: Parent directory of sftp://brok.diku.dk/usr/local/projects/disk07/dirdiffsim/bachelorprojekt/trunk does not exist.
You may supply --create-prefix to create all leading parent directories.
loldrup@explab:~/dirdiffsim/bachelorprojekt/trunk$ bzr push sftp://brok.diku.dk/usr/local/projects/disk07/dirdiffsim/bachelorprojekt/trunk --create-prefix
<email address hidden>'s password:
Created new branch.
loldrup@explab:~/dirdiffsim/bachelorprojekt/trunk$

Then I go to the server via SSH and look in the trunk, but theres nothing to be found. The same is the result if I follow the other suggestion ("Making an empty central branch then committing content to it"). I can post the command line log for that as well, it wanted.
I know I 'got through' to the server - the directory bachelorprojekt and its .bzr directory are created. Just not my hello.py

Question information

Language:
English Edit question
Status:
Solved
For:
Bazaar Edit question
Assignee:
No assignee Edit question
Solved by:
Jon Loldrup
Solved:
Last query:
Last reply:
Revision history for this message
Martin Pool (mbp) said :
#1

bzr doesn't create or update a working tree over sftp. The history of
your project is there inside .bzr.

If you want a checked-out copy of the tree on the server, run 'bzr
checkout' in that directory on brok, then 'bzr update' after you push
new changes.

You can automate this with the push-and-upload plugin.

Revision history for this message
Jon Loldrup (loldrup) said :
#2

Martin wrote:
"bzr doesn't create or update a working tree over sftp"

Should I use another protocol then? Or is the 'official' way of running a central branch (but still having distributed branches as well) simply to install this push-and-upload plugin?

Revision history for this message
Vincent Ladeuil (vila) said :
#3

'bzr update' can create conflicts. In this case, a human has to resolve them and commit.

That's the main reason to use a *branch* without a working tree when working with a central branch. The branch itself (and its associated repository) contains the whole history and is sufficient to support the centralized model. There is no need for a 'central' working tree.

push-and-upload addresses a different use case where a remote working tree needs to be kept up-to-date but it's generally used by a single user in which case 'bzr update' is less likely to produce conflicts.

Updating a remote working tree via the smart server is a feature that has been discussed though.

Revision history for this message
Jon Loldrup (loldrup) said :
#4

Wincent wrote:
<snip>

Ok

All I lacked was to do a pull on the other end. Now it works :)

Revision history for this message
Jon Loldrup (loldrup) said :
#5

for other in the same situation - do this:
bzr init-repo PROJECT
cd PROJECT
bzr pull sftp://brok.diku.dk/usr/local/projects/disk07/dirdiffsim/bachelorprojekt/trunk