Commit fails when checkout uses the same repo as its branch

Bug #177592 reported by Christian Tschabuschnig
2
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Medium
Aaron Bentley

Bug Description

This is for bzr.dev, revision 3132

Steps to reproduce:

tschaboo@feisty64:~/x$ ls -l
total 4
drwxr-xr-x 10 tschaboo tschaboo 4096 2007-12-20 03:08 somerepo
tschaboo@feisty64:~/x$ bzr init-repository ttt
tschaboo@feisty64:~/x$ cd ttt
tschaboo@feisty64:~/x/ttt$ bzr branch ../somerepo/ R1
Branched 801 revision(s).
tschaboo@feisty64:~/x/ttt$ bzr checkout --lightweight R1 R2
tschaboo@feisty64:~/x/ttt$ cd R2
tschaboo@feisty64:~/x/ttt/R2$ bzr reconfigure --checkout
tschaboo@feisty64:~/x/ttt/R2$ bzr remove README
deleted README
tschaboo@feisty64:~/x/ttt/R2$ bzr commit -m "asdf"
Committing to: /home/tschaboo/x/ttt/R1/
deleted README
bzr: ERROR: bzrlib.errors.NoSuchRevision: KnitPackRevisionStore(VersionedFileStore('file:///home/tschaboo/x/ttt/.bzr/repository/')) has no revision tschaboo@feisty64-20071220020915-7yzw5rr37s5mqnsv

Traceback (most recent call last):
  File "/home/tschaboo/bin/bazaar/bzrlib/commands.py", line 802, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/home/tschaboo/bin/bazaar/bzrlib/commands.py", line 758, in run_bzr
    ret = run(*run_argv)
  File "/home/tschaboo/bin/bazaar/bzrlib/commands.py", line 492, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/home/tschaboo/bin/bazaar/bzrlib/builtins.py", line 2327, in run
    author=author)
  File "/home/tschaboo/bin/bazaar/bzrlib/decorators.py", line 165, in write_locked
    return unbound(self, *args, **kwargs)
  File "/home/tschaboo/bin/bazaar/bzrlib/workingtree_4.py", line 245, in commit
    result = WorkingTree3.commit(self, message, revprops, *args, **kwargs)
  File "/home/tschaboo/bin/bazaar/bzrlib/decorators.py", line 165, in write_locked
    return unbound(self, *args, **kwargs)
  File "/home/tschaboo/bin/bazaar/bzrlib/mutabletree.py", line 187, in commit
    revprops=revprops, *args, **kwargs)
  File "/home/tschaboo/bin/bazaar/bzrlib/commit.py", line 386, in commit
    revision_id=self.rev_id)
  File "/home/tschaboo/bin/bazaar/bzrlib/repository.py", line 869, in fetch
    self.get_revision(revision_id)
  File "/home/tschaboo/bin/bazaar/bzrlib/decorators.py", line 127, in read_locked
    return unbound(self, *args, **kwargs)
  File "/home/tschaboo/bin/bazaar/bzrlib/repofmt/knitrepo.py", line 185, in get_revision
    return self.get_revision_reconcile(revision_id)
  File "/home/tschaboo/bin/bazaar/bzrlib/decorators.py", line 127, in read_locked
    return unbound(self, *args, **kwargs)
  File "/home/tschaboo/bin/bazaar/bzrlib/repository.py", line 998, in get_revision_reconcile
    return self._get_revisions([revision_id])[0]
  File "/home/tschaboo/bin/bazaar/bzrlib/decorators.py", line 127, in read_locked
    return unbound(self, *args, **kwargs)
  File "/home/tschaboo/bin/bazaar/bzrlib/repository.py", line 1012, in _get_revisions
    self.get_transaction())
  File "/home/tschaboo/bin/bazaar/bzrlib/store/revision/knit.py", line 88, in get_revisions
    texts = self._get_serialized_revisions(revision_ids, transaction)
  File "/home/tschaboo/bin/bazaar/bzrlib/store/revision/knit.py", line 106, in _get_serialized_revisions
    raise errors.NoSuchRevision(self, e.revision_id)
NoSuchRevision: KnitPackRevisionStore(VersionedFileStore('file:///home/tschaboo/x/ttt/.bzr/repository/')) has no revision tschaboo@feisty64-20071220020915-7yzw5rr37s5mqnsv

bzr 1.1.0.dev.0 on python 2.5.1.final.0 (linux2)
arguments: ['/home/tschaboo/bin/bazaar/bzr', 'commit', '-m', 'asdf']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_US.UTF-8'
plugins:
  gtk /home/tschaboo/.bazaar/plugins/gtk [0.92.1]
  launchpad /home/tschaboo/bin/bazaar/bzrlib/plugins/launchpad [unknown]
  multiparent /home/tschaboo/bin/bazaar/bzrlib/plugins/multiparent.pyc [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.

Revision history for this message
Aaron Bentley (abentley) wrote :

This doesn't seem related to the reconfiguration. Here's a test script that reproduces the issue without reconfiguring.
It's probably just related to having the checkout in the same repo as the branch.
For knit repos, this causes lock errors. For packs, it causes this.

Here's a test case.

    def test_commit_in_new_checkout(self):
        repo = self.make_repository('repo', shared=True)
        # make_branch_and_tree ignores shared repos
        branch = bzrdir.BzrDir.create_branch_convenience('repo/branch')
        tree2 = branch.create_checkout('repo/tree2')
        tree2.commit('message', rev_id='rev1')

Changed in bzr:
importance: Undecided → Medium
status: New → Confirmed
Aaron Bentley (abentley)
Changed in bzr:
assignee: nobody → aaron-bentley
Aaron Bentley (abentley)
Changed in bzr:
milestone: none → 1.1
status: Confirmed → Fix Committed
Aaron Bentley (abentley)
Changed in bzr:
status: Fix Committed → Fix Released
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.