bzr revert can't delete parent directory because it should delete children first

Bug #477475 reported by Alexander Belchenko
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Medium
Unassigned

Bug Description

bzr 2.0.2 on Windows. I did wrong merge then trying to revert. Revert failed to remove newly added directories, because it should remove entries in different order: children at first then parents.

C:\work\MyCode\xxx>bzr merge C:\work\MyCode\yyy\src\common\key_func.c --unco
+N src/
+N src/common/
+N src/common/key_func.c.OTHER
Conflict adding files to src. Created directory.
Conflict because src is not versioned, but has versioned children. Versioned directory.
Conflict adding files to src/common. Created directory.
Conflict because src/common is not versioned, but has versioned children. Versioned directory.
Contents conflict in src/common/key_func.c
5 conflicts encountered.

C:\work\MyCode\xxx>bzr revert
- src/
- src/common/
-D src/common/key_func.c.OTHER
Conflict: can't delete src because it is not empty. Not deleting.
Conflict: can't delete src/common because it is not empty. Not deleting.

C:\work\MyCode\xxx\src\common>dir
 Volume in drive C is XP
 Volume Serial Number is B47B-BD42

 Directory of C:\work\MyCode\xxx\src\common

07.11.2009 16:33 <DIR> .
07.11.2009 16:33 <DIR> ..
               0 File(s) 0 bytes
               2 Dir(s) 28 078 374 912 bytes free

As you can see src/common is empty after revert.
The last 2 conflicts (unable to delete directory) should not be here really. It's so silly.

Changed in bzr:
status: New → Confirmed
tags: added: win32
Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 477475] [NEW] bzr revert can't delete parent directory because it should delete children first

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Alexander Belchenko wrote:
> Public bug reported:
>
> bzr 2.0.2 on Windows. I did wrong merge then trying to revert. Revert
> failed to remove newly added directories, because it should remove
> entries in different order: children at first then parents.
>
> C:\work\MyCode\xxx>:\work\MyCode\yyy\src\common\key_func.c --unco

^- something strange with your copy and paste here.

> +N src/
> +N src/common/
> +N src/common/key_func.c.OTHER
> Conflict adding files to src. Created directory.
> Conflict because src is not versioned, but has versioned children. Versioned directory.
> Conflict adding files to src/common. Created directory.
> Conflict because src/common is not versioned, but has versioned children. Versioned directory.
> Contents conflict in src/common/key_func.c
> 5 conflicts encountered.
>
> C:\work\MyCode\xxx>bzr revert
> - src/
> - src/common/
> -D src/common/key_func.c.OTHER
> Conflict: can't delete src because it is not empty. Not deleting.
> Conflict: can't delete src/common because it is not empty. Not deleting.
>
> C:\work\MyCode\xxx\src\common>dir
> Volume in drive C is XP
> Volume Serial Number is B47B-BD42
>
> Directory of C:\work\MyCode\xxx\src\common
>
> 07.11.2009 16:33 <DIR> .
> 07.11.2009 16:33 <DIR> ..
> 0 File(s) 0 bytes
> 2 Dir(s) 28 078 374 912 bytes free
>
>
> As you can see src/common is empty after revert.
> The last 2 conflicts (unable to delete directory) should not be here really. It's so silly.
>

I can reproduce this result with:

bzr init A
bzr mkdir A/b
bzr mkdir A/b/c
echo foo > A/b/c/d
bzr add A
bzr commit A -m "initial a"
bzr branch A B
echo bar >> B/b/c/d
bzr commit B -m "modify d"
bzr rm A/b
bzr commit A -m "remove b"
cd A
bzr merge ../B
bzr revert

At this point I have the directory "b/c" but it certainly appears to be
empty. I've reproduced this on both Windows an Linux using bzr.dev.

John
=:->

  status confirmed
  importance medium
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkr1q/wACgkQJdeBCYSNAAP1DQCgupORzm+Df8NThVX/pg+LBucy
ucAAmwXZuvgucgyuxs2CnlKTZWSkHw3T
=BxlY
-----END PGP SIGNATURE-----

Changed in bzr:
importance: Undecided → Medium
Revision history for this message
Alexander Belchenko (bialix) wrote : Re: [Bug 477475] [NEW] bzr revert can't delete parent directory because it should delete children first

John A Meinel пишет:
> Alexander Belchenko wrote:
>> Public bug reported:
>
>> bzr 2.0.2 on Windows. I did wrong merge then trying to revert. Revert
>> failed to remove newly added directories, because it should remove
>> entries in different order: children at first then parents.
>
>> C:\work\MyCode\xxx>:\work\MyCode\yyy\src\common\key_func.c --unco
>
> ^- something strange with your copy and paste here.

It was very long command-line and FAR shrink it this way. Read it as:

C:\work\MyCode\xxx>bzr merge C:\work\MyCode\yyy\src\common\key_func.c --unco

Sorry, I did not check it properly.

description: updated
tags: removed: win32
Jelmer Vernooij (jelmer)
tags: added: revert
Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.