Committing in a lightweight checkout stores revision in branch but does not update branch's files, expected?

Asked by GuilhemBichot

If I have a branch (in a directory dir1), with a file named "a", make a lightweigtht checkout of it into directory dir2, edit the "a" file in dir2, "bzr gcommit" in dir2 and commit, then go into dir1 and do "bzr log" I see the new committed revision; but dir1/a is still old, it does not have the committed change ("bzr cat a" does show the committed change). And though it's old, different from the latest committed version, "bzr diff" shows nothing.
I think this is quite misleading: assume that after some time you look at dir1, see in "bzr log" that it is up-to-date, then start reading its files and modifying them: you are unknowingly reading/modifying old files.
cd /tmp
bzr init dir1
cd dir1
echo test > a
bzr add a
bzr gcommit
cd ..
bzr checkout --lightweight dir1 dir2
cd dir2
echo test2 > a
bzr gcommit
bzr log # shows rev 1 and 2, ok
cd ../dir1
bzr log # shows rev 1 and 2, ok
cat a # shows 'test' instead of 'test2' ??
bzr diff # shows nothing! so file is not identical to latest revision, and this does not show up in diff??
# more strangeness:
echo test3 > a
bzr diff # shows: - test + test3, so ignores "test2" ?? says that the latest line before edit was "test" ??

Shouldn't the commit, when done in dir2 and propagated to dir1, also cause an automatic "refresh" of files in dir1?

Question information

Language:
English Edit question
Status:
Solved
For:
Bazaar Edit question
Assignee:
No assignee Edit question
Solved by:
GuilhemBichot
Solved:
Last query:
Last reply:
Revision history for this message
GuilhemBichot (guilhem-bichot) said :
#1

After reading more, I realize that if I do
 cd dir1
 bzr update
then the "a" file in dir1 gets updated. "bzr update" tells it all, one has to run "bzr update" by hand in the branch after every commit in the checkout, or use a plugin to automate that.
So, the observed behaviour is probably per the documentation, I mark it as solved.

Revision history for this message
John A Meinel (jameinel) said :
#2

Also, if you run:
  cd dir1
  bzr status

Then it should tell you that your tree is out of date, and that you should run "bzr update".