unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Bzr question about moving and renaming files
@ 2013-06-20 15:01 Stephen Berman
  2013-06-20 15:26 ` Glenn Morris
  2013-06-20 16:57 ` Eli Zaretskii
  0 siblings, 2 replies; 8+ messages in thread
From: Stephen Berman @ 2013-06-20 15:01 UTC (permalink / raw)
  To: emacs-devel

I'm getting close to committing my new version of todo-mode.el (except
for the Texinfo user manual, which will take more time), and want to try
and avoid any unpleasant mistake with bzr, which I'm not all that
experienced with.  I did a test run in my local branch, and had to use
two commits: first, rename calendar/todo-mode.el to
obsolete/otodo-mode.el, commit this, and then add the new version as
calendar/todo-mode.el and commit that.  I had tried adding the new
version before committing the rename, but vc-rename-file errored with
"Please update files before moving them".  Now, when I push my changes
to trunk at Savannah (via my local mirror, which is bound to it), do I
have to replicate this two-step procedure, or can I just do one bzr
commit (or rather `C-c C-c' from the VC log buffer) and that will
install the new version in calendar/, overwriting the old version, and
install the renamed old version in obsolete/?  I'm guessing I have to do
it in two commits, but I'd appreciate confirmation, or, if it is possible
to do it in one commit, a recipe for how to do it.

Steve Berman



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Bzr question about moving and renaming files
  2013-06-20 15:01 Bzr question about moving and renaming files Stephen Berman
@ 2013-06-20 15:26 ` Glenn Morris
  2013-06-20 20:17   ` Stephen Berman
  2013-06-20 16:57 ` Eli Zaretskii
  1 sibling, 1 reply; 8+ messages in thread
From: Glenn Morris @ 2013-06-20 15:26 UTC (permalink / raw)
  To: Stephen Berman; +Cc: emacs-devel

Stephen Berman wrote:

> I did a test run in my local branch, and had to use two commits:
> first, rename calendar/todo-mode.el to obsolete/otodo-mode.el, commit
> this, and then add the new version as calendar/todo-mode.el and commit
> that. I had tried adding the new version before committing the rename,
> but vc-rename-file errored with "Please update files before moving
> them".

I am sure you would get a more authoritative answer to bzr questions on
the bzr mailing list, but it works fine for me to use one commit:

mkdir /tmp/foo
cd /tmp/foo
bzr init
touch foo
bzr add foo
bzr commit -m "c1"
bzr mv foo bar
touch foo
bzr add foo
bzr commit -m "c2"



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Bzr question about moving and renaming files
  2013-06-20 15:01 Bzr question about moving and renaming files Stephen Berman
  2013-06-20 15:26 ` Glenn Morris
@ 2013-06-20 16:57 ` Eli Zaretskii
  2013-06-20 20:17   ` Stephen Berman
  1 sibling, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2013-06-20 16:57 UTC (permalink / raw)
  To: Stephen Berman; +Cc: emacs-devel

> From: Stephen Berman <stephen.berman@gmx.net>
> Date: Thu, 20 Jun 2013 17:01:04 +0200
> 
> Now, when I push my changes to trunk at Savannah (via my local
> mirror, which is bound to it)

If your local mirror is bound to Savannah, then how did you commit
your changes?  Did you use "bzr ci --local"?  If not, your commits are
already on Savannah, because committing in a bound branch pushes the
changes to the master repository.

> do I have to replicate this two-step procedure, or can I just do one
> bzr commit (or rather `C-c C-c' from the VC log buffer) and that
> will install the new version in calendar/, overwriting the old
> version, and install the renamed old version in obsolete/?  I'm
> guessing I have to do it in two commits, but I'd appreciate
> confirmation, or, if it is possible to do it in one commit, a recipe
> for how to do it.

One commit should be all you need.  It will reproduce on Savannah the
entire history you have locally, including the rename.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Bzr question about moving and renaming files
  2013-06-20 15:26 ` Glenn Morris
@ 2013-06-20 20:17   ` Stephen Berman
  2013-06-20 20:51     ` Stefan Monnier
  0 siblings, 1 reply; 8+ messages in thread
From: Stephen Berman @ 2013-06-20 20:17 UTC (permalink / raw)
  To: Glenn Morris; +Cc: emacs-devel

On Thu, 20 Jun 2013 11:26:35 -0400 Glenn Morris <rgm@gnu.org> wrote:

> Stephen Berman wrote:
>
>> I did a test run in my local branch, and had to use two commits:
>> first, rename calendar/todo-mode.el to obsolete/otodo-mode.el, commit
>> this, and then add the new version as calendar/todo-mode.el and commit
>> that. I had tried adding the new version before committing the rename,
>> but vc-rename-file errored with "Please update files before moving
>> them".
>
> I am sure you would get a more authoritative answer to bzr questions on
> the bzr mailing list, but it works fine for me to use one commit:
>
> mkdir /tmp/foo
> cd /tmp/foo
> bzr init
> touch foo
> bzr add foo
> bzr commit -m "c1"
> bzr mv foo bar
> touch foo
> bzr add foo
> bzr commit -m "c2"

The subject line should probably have said "VC question...", because
that's what I was using (with the bzr backend) and that's where the
problems seem to be.  I'm not able to reproduce the error I reported
above; perhaps I did something wrong before to get that.  But I still
can't rename a file and before committing that add another file with the
same name as the one before the renaming.  Here's what I did:

1. I reproduced your steps through the first `touch foo', then with
   emacs -Q called vc-dir on /tmp/foo, which showed file foo
   unregistered.
2. I typed `i' to register it, successfully, then `v' to get a log
   buffer, entered a message and typed `C-c C-c' to commit the change.  
3. Then `M-x vc-rename-file foo RET bar', which also succeeded, but
   didn't commit this.  
4. Then back to the shell and again `touch foo', then back to vc-dir,
   which shows:
         edited       bar (renamed from foo)
         unregistered foo 
5. Now when I type `i' on foo, it fails with "vc-register: This file is
   already registered".  Only after typing `v' on file bar and
   committing the rename can I successfully type `i' on the new foo to
   register it.

Is this a known limitation of VC or a bug?

Steve Berman



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Bzr question about moving and renaming files
  2013-06-20 16:57 ` Eli Zaretskii
@ 2013-06-20 20:17   ` Stephen Berman
  2013-06-20 20:55     ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Stephen Berman @ 2013-06-20 20:17 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

On Thu, 20 Jun 2013 19:57:34 +0300 Eli Zaretskii <eliz@gnu.org> wrote:

>> From: Stephen Berman <stephen.berman@gmx.net>
>> Date: Thu, 20 Jun 2013 17:01:04 +0200
>> 
>> Now, when I push my changes to trunk at Savannah (via my local
>> mirror, which is bound to it)
>
> If your local mirror is bound to Savannah, then how did you commit
> your changes?  Did you use "bzr ci --local"?  If not, your commits are
> already on Savannah, because committing in a bound branch pushes the
> changes to the master repository.

I wasn't saying I already pushed the changes but asking what I should do
when I push them.  My test run was on a non-bound branch.

>> do I have to replicate this two-step procedure, or can I just do one
>> bzr commit (or rather `C-c C-c' from the VC log buffer) and that
>> will install the new version in calendar/, overwriting the old
>> version, and install the renamed old version in obsolete/?  I'm
>> guessing I have to do it in two commits, but I'd appreciate
>> confirmation, or, if it is possible to do it in one commit, a recipe
>> for how to do it.
>
> One commit should be all you need.  It will reproduce on Savannah the
> entire history you have locally, including the rename.

Yes, that's what Glenn's test also showed, but it doesn't seem to work
using VC, see my followup to him.

Steve Berman



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Bzr question about moving and renaming files
  2013-06-20 20:17   ` Stephen Berman
@ 2013-06-20 20:51     ` Stefan Monnier
  2013-06-20 21:07       ` Stephen Berman
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Monnier @ 2013-06-20 20:51 UTC (permalink / raw)
  To: Stephen Berman; +Cc: emacs-devel

> Is this a known limitation of VC or a bug?

VC has lot and lots of such limitations/bugs.
It's OK for "edit & commit" but I don't recommend it for anything beyond
that, sadly.


        Stefan



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Bzr question about moving and renaming files
  2013-06-20 20:17   ` Stephen Berman
@ 2013-06-20 20:55     ` Eli Zaretskii
  0 siblings, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2013-06-20 20:55 UTC (permalink / raw)
  To: Stephen Berman; +Cc: emacs-devel

> From: Stephen Berman <stephen.berman@gmx.net>
> Cc: emacs-devel@gnu.org
> Date: Thu, 20 Jun 2013 22:17:38 +0200
> 
> > One commit should be all you need.  It will reproduce on Savannah the
> > entire history you have locally, including the rename.
> 
> Yes, that's what Glenn's test also showed, but it doesn't seem to work
> using VC, see my followup to him.

Then don't use VC.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Bzr question about moving and renaming files
  2013-06-20 20:51     ` Stefan Monnier
@ 2013-06-20 21:07       ` Stephen Berman
  0 siblings, 0 replies; 8+ messages in thread
From: Stephen Berman @ 2013-06-20 21:07 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

On Thu, 20 Jun 2013 16:51:51 -0400 Stefan Monnier <monnier@iro.umontreal.ca> wrote:

>> Is this a known limitation of VC or a bug?
>
> VC has lot and lots of such limitations/bugs.
> It's OK for "edit & commit" but I don't recommend it for anything beyond
> that, sadly.

Pity.



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-06-20 21:07 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-20 15:01 Bzr question about moving and renaming files Stephen Berman
2013-06-20 15:26 ` Glenn Morris
2013-06-20 20:17   ` Stephen Berman
2013-06-20 20:51     ` Stefan Monnier
2013-06-20 21:07       ` Stephen Berman
2013-06-20 16:57 ` Eli Zaretskii
2013-06-20 20:17   ` Stephen Berman
2013-06-20 20:55     ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).