rm with bzr
Erik Bågfors
zindar at gmail.com
Mon Nov 20 08:55:12 GMT 2006
On 11/19/06, Alex Chen <alex.chen.hl at gmail.com> wrote:
>
> I'm a bzr newbie come from cvs. I put all my workspace under bzr
> controlling with "bzr init".
> One day, I "rm"ed some files by mistake, then I did a check-in. And
> several days later, I noticed that there missing some files. Then I use
> "bzr update", and expected the 'rm'ed files will show up as my experience
> with cvs. But nothing happened, bzr told me it's update-to-date already.
> I do some test later. I found when I "rm" a file and check-in, bzr will
> report the file as "removed" as if you had do "bzr remove" on it. Is this
> behavior intentioned? What's the benefit of this behavior that could
> exceed the risk of mis-action?
It is the intended behavior, I'll let someone else decide if it's
good or bad :)
> How to know what files I removed?
I think the easiest is bzr log -v
Search for "removed:", You'll see something like this
revno: 2
committer: Erik Bågfors <erik at bagfors.nu>
branch nick: p
timestamp: Mon 2006-11-20 09:48:51 +0100
message:
removed hosts
removed:
hosts
Then I know that that file was removed in revno 2
> "bzr log ." only showed the "initial" revision. Is the files adding and
> removing a kind of change for directory? If it is, why not log report the
> related revision?(I have check-in for adding or removing files for several
> times under this directory);
> "bzr diff ." show a lot of infos including file content differences, and I
> cannot find the option to only display the difference at file level as
> "foo.c ADDED; Boo.h CHANGED"
>
> What should I do to get the files back? Must I branch a revision which has
> those files and copy the removed files back to trunk?
no. In the above example, use "bzr revert -r 1 hosts"
> When I use 'bzr st', there will be a lot of files listed as unknown. Since
> I'm only interested in Modified, Added, renamed and so on, and lasy to add
> all the Unknown files to ignore list, is there any option to suppress the
> displaying of unknowns?
well.. You can list all unknowns with "bzr ls --unknown". Then you
can add them to the ignore list with "bzr ignore". So a combination
would be
for f in $(bzr ls --unknown); do bzr ignore "$f"; done
A better way to do it is to work with patterns
/Erik
--
google talk/jabber. zindar at gmail.com
SIP-phones: sip:erik_bagfors at gizmoproject.com
sip:17476714687 at proxy01.sipphone.com
More information about the bazaar
mailing list