commit --exclude should NOT exclude TREE_ROOT

Bug #299879 reported by Alexander Belchenko
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Medium
Unassigned
Bazaar Explorer
Invalid
Undecided
Unassigned
Breezy
Fix Released
Medium
Jelmer Vernooij
QBzr
Invalid
Undecided
Unassigned

Bug Description

If branch has no commits, then --exclude `bzr root` fails. It's working OK if there is at least one commit.

C:\Temp>mkdir 4

C:\Temp>cd 4
C:\Temp\4>

C:\Temp\4>bzr init
Standalone tree (format: pack-0.92)
Location:
  branch root: .

C:\Temp\4>bzr ci -m test --exclude . --unchanged
Committing to: C:/Temp/4/
bzr: ERROR: exceptions.AssertionError: Root entry should be supplied to record_entry_contents, as of bzr 0.10.

Traceback (most recent call last):
  File "bzrlib\commands.pyo", line 893, in run_bzr_catch_errors
  File "bzrlib\commands.pyo", line 839, in run_bzr
  File "bzrlib\commands.pyo", line 539, in run_argv_aliases
  File "bzrlib\builtins.pyo", line 2431, in run
  File "bzrlib\decorators.pyo", line 192, in write_locked
  File "bzrlib\workingtree_4.pyo", line 237, in commit
  File "bzrlib\decorators.pyo", line 192, in write_locked
  File "bzrlib\mutabletree.pyo", line 201, in commit
  File "bzrlib\commit.pyo", line 377, in commit
  File "bzrlib\repository.pyo", line 159, in finish_inventory
AssertionError: Root entry should be supplied to record_entry_contents, as of bzr 0.10.

bzr 1.9 on python 2.5.2 (win32)
arguments: ['C:\\Program Files\\Bazaar\\bzr.EXE', 'ci', '-m', 'test', '--exclude', '.', '--unchanged']
encoding: 'cp1251', fsenc: 'mbcs', lang: 'ru'
plugins:
  acad C:\work\Bazaar\plugins\acad [0.6.1]
  bzrtools C:\Program Files\Bazaar\plugins\bzrtools [1.9.1]
  launchpad C:\Program Files\Bazaar\plugins\launchpad [unknown]
  qbzr C:\work\Bazaar\plugins\qbzr [0.9.6dev0]
  rebase C:\work\Bazaar\plugins\rebase [0.4.1]
  repo_push C:\work\Bazaar\plugins\repo_push [1.1.1]
  svn C:\Program Files\Bazaar\plugins\svn [0.4.14]
  x_bit C:\work\Bazaar\plugins\x_bit [unknown]
*** Bazaar has encountered an internal error.
    Please report a bug at https://bugs.launchpad.net/bzr/+filebug
    including this traceback, and a description of what you
    were doing when the error occurred.

Tags: commit

Related branches

Revision history for this message
Jelmer Vernooij (jelmer) wrote : Re: [Bug 299879] [NEW] commit --exclude should NOT exclude TREE_ROOT

Interesting bug..

  status triaged
  importance medium
--
Jelmer Vernooij <email address hidden> - http://samba.org/~jelmer/
Jabber: <email address hidden>

Changed in bzr:
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 299879] [NEW] commit --exclude should NOT exclude TREE_ROOT

> C:\Temp\4>bzr ci -m test --exclude . --unchanged
> Committing to: C:/Temp/4/
> bzr: ERROR: exceptions.AssertionError: Root entry should be supplied to record_entry_contents, as of bzr 0.10.

Fun!

So, the base problem is that the first commit has to add the root of the
tree - we don't support trees with /no/ root.

And the exclude code is permitted to exclude everything. So, I consider
this a misleading error message, but not a bug - that commit *is not
valid*.

 status confirmed
 importance medium

Changed in bzr:
status: Triaged → Confirmed
Revision history for this message
Alexander Belchenko (bialix) wrote :

How's nice! It's not bug -- it's feature.

It's a leaking abstraction. Leaking in the face of user. The same command-line for any other commit works fine. Only first commit is so special. You need to commit TREE_ROOT always? Why you doing it implicitly on first user commit? Why not doing it explicitly on branch initialization? Automatic explicit commit by bzr itself to froze TREE_ROOT.

:-/

"Special cases aren't special enough to break the rules" ?

Changed in bzr-explorer:
status: New → Won't Fix
status: Won't Fix → Invalid
Revision history for this message
Martin Pool (mbp) wrote : Re: [Bug 299879] Re: commit --exclude should NOT exclude TREE_ROOT

2009/11/4 Alexander Belchenko <email address hidden>:
> How's nice! It's not bug -- it's feature.
>
> It's a leaking abstraction. Leaking in the face of user. The same
> command-line for any other commit works fine. Only first commit is so
> special. You need to commit TREE_ROOT always? Why you doing it
> implicitly on first user commit? Why not doing it explicitly on branch
> initialization? Automatic explicit commit by bzr itself to froze
> TREE_ROOT.

So you think maybe this command should succeed and silently add the
tree root, so to the user it looks like a command that changed no
files?

--
Martin <http://launchpad.net/~mbp/>

Revision history for this message
Alexander Belchenko (bialix) wrote :

Martin Pool пишет:
> 2009/11/4 Alexander Belchenko <email address hidden>:
>> How's nice! It's not bug -- it's feature.
>>
>> It's a leaking abstraction. Leaking in the face of user. The same
>> command-line for any other commit works fine. Only first commit is so
>> special. You need to commit TREE_ROOT always? Why you doing it
>> implicitly on first user commit? Why not doing it explicitly on branch
>> initialization? Automatic explicit commit by bzr itself to froze
>> TREE_ROOT.
>
> So you think maybe this command should succeed and silently add the
> tree root, so to the user it looks like a command that changed no
> files?

Yes, it was my natural expectation. I have no way to control the TREE_ROOT entry from command-line,
as a plain user I even should not know that TREE_ROOT exists, right? In this case I'd expect to see
all machinery with TREE_ROOT working behind the scene.

If I'm wrong, please explain why and where.

Revision history for this message
Martin Pool (mbp) wrote :

To me at the cli level that would be reasonable.

Changed in qbzr:
status: New → Invalid
Jelmer Vernooij (jelmer)
tags: added: commit
Jelmer Vernooij (jelmer)
Changed in brz:
status: New → Triaged
importance: Undecided → Medium
assignee: nobody → Jelmer Vernooij (jelmer)
Jelmer Vernooij (jelmer)
Changed in brz:
status: Triaged → Fix Released
milestone: none → 3.0.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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