Is it normal to have a number or revisions in bzr info -v and another if I count the revisions "by hand"?

Asked by Edmundo

I have a repository. bzr check shows no problem.... however, look at this output:
bzr info -v | grep revisions; bzr log -r -1 | grep '^'revno; bzr log | grep -c revno
       474 revisions
      2573 revisions
revno: 474
2565

There are 474 revisions in the branch history and 2573 revisions in the repository. bzr log -r -1 sais the revision is 474. Cool! But look at the count of revisions with grep -c. They differ. That means the repository is broken? Or that's OK?

Question information

Language:
English Edit question
Status:
Answered
For:
Bazaar Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Wouter van Heyst (larstiq) said :
#1

On Mon, Aug 04, 2008 at 06:25:54PM -0000, Edmundo wrote:
> New question #41205 on Bazaar:
> https://answers.launchpad.net/bzr/+question/41205
>
> I have a repository. bzr check shows no problem.... however, look at this output:
> bzr info -v | grep revisions; bzr log -r -1 | grep '^'revno; bzr log | grep -c revno
> 474 revisions
> 2573 revisions
> revno: 474
> 2565
>
> There are 474 revisions in the branch history and 2573 revisions in the repository. bzr log -r -1 sais the revision is 474. Cool! But look at the count of revisions with grep -c. They differ. That means the repository is broken? Or that's OK?

A repository can act as revision storage for more than one branch.
Looking at the revisions for one particular branch only tells you that
those are in the repository, but you can't conclude that there aren't
more present. So yes, this would be expected.

If you look at the bzr info output, it should tell you what the location
of the repository is, and what the location of the branch is. In my case:

lappu%~/src/bzr/bzr.dev> bzr info
Repository tree (format: pack-0.92)
Location:
  shared repository: /home/larstiq/src/bzr
  repository branch: .

Related branches:
  parent branch: http://bazaar-vcs.org/bzr/bzr.dev/

lappu%~/src/bzr/bzr.dev> ls /home/larstiq/src/bzr
1.5 bug30159 bzr.dev tbzr2-proto

So you see 4 branches in that repository (there might be more, more deeply nested).

Wouter

Revision history for this message
Edmundo (eantoranz) said :
#2

Well.. that sounds logical... but that would require using shared
repositories? right? But that's not the case here. Would that make sence
even without shared repos?

> bzr info -v; bzr log | grep -c revno
Standalone tree (format: pack-0.92)
Location:
  branch root: .

Related branches:
  parent branch: /home/desarrollo/informaw/estable
  submit branch: /home/desarrollo/informaw/estable

Format:
       control: Meta directory format 1
  working tree: Working tree format 4
        branch: Branch format 6
    repository: Packs containing knits without subtree support

In the working tree:
     11941 unchanged
         0 modified
         0 added
         0 removed
         0 renamed
         5 unknown
        53 ignored
       445 versioned subdirectories

Branch history:
       474 revisions
        18 committers
        21 days old
   first revision: Mon 2008-07-14 10:46:21 -0500
  latest revision: Mon 2008-08-04 13:01:09 -0500

Repository:
      2573 revisions
    160642 KiB
2565

Revision history for this message
John A Meinel (jameinel) said :
#3

If you ever used "bzr uncommit" or did "bzr merge" and then changed your mind before committing (bzr revert).
There are even other ways to fetch other revisions into your local repository, though those are the most common.

In short, it isn't something that I would worry about. If you *really* want to clean out unreferenced revisions you can:

bzr branch cur_branch new_branch
rm -rf cur_branch
mv new_branch cur_branch

(Note that this will change the 'parent' pointer, but you can do "bzr pull --remember old_parent" to get it back.)

Can you help with this problem?

Provide an answer of your own, or ask Edmundo for more information if necessary.

To post a message you must log in.