Comment 3 for bug 632704

Revision history for this message
RayH (ray-hunter) wrote : Re: After upgrading from 1.10 to 2.2.0 I get "unversioned parent" on one particular repository

Thankyou for your suggestion. I have kept a local copy of the server repostory and the local branch for any future debugging and recreated the repository (minus any version info of course)

I achieved this by doing the following (for future reference if anyone else hits this problem)

on the Linux repository server

# move corrupted repo out of the way
bzr@xxxx01:~$ mv gnms-xxxx-bin gnms-xxxx-bin-safe

# create a new clean repo
bzr@xxxx01:~$ ./repo.bash gnms-xxxx-bin

the contents of the repository creation repo.bash script are:

#!/bin/sh
if [$1 = ""] ; then
  echo Must have arg name of directory
  exit
fi
echo creating top level repo $1

/usr/bin/bzr init-repo /home/bzr/$1 --no-trees
cd /home/bzr/$1

echo initing next level repo trunk

# create a clean branch
/usr/bin/bzr init trunk

cd /home/bzr
chown -R :xxxx $1
find $1 -type d -print0| xargs -0 echo "changing directories"
find $1 -type d -print0| xargs -0 chmod 2775
find $1 -type d -print0| xargs -0 echo "changing files"
find $1 -type f -print0 | xargs -0 chmod 664

on local client machine

de-install old version of bzr
install new version of bzr

make a safe copy of your_branch on the local machine somewhere else outside of the version control directories

cd your_branch

  Make a note of the binding for the checkout of your branch: depends on machine location so look in .bzr/branch/branch.conf
  The file should contain a line "bound_location = blah blah"
  Make a note of this e.g.
  bzr+ssh://<email address hidden>:10xx///home/bzr/gnms-xxxx-bin/trunk/
  bzr://127.0.0.1/gnms-xxxx-bin/trunk/

#unbind existing repo
bzr unbind

# stop this being a branch
manually move .bzr folder out of root directory to somewhere else (keep a copy for future debugging)

check contents of .bzrignore
should be something like

*.bak
*/blib/*
blib
*.pid
*.log

# create a new clean repository in original code directory
# this will create a new clean .bzr directory
bzr init

# bind it to the new clean version on the server using the binding "blah blah" that you noted earlier
bzr bind bzr://127.0.0.1/gnms-xxxx-bin/trunk

# set who you are for info
bzr whoami "RayH <RayH@xxxx>"

# check what will be added: alter .bzrignore if unhappy
bzr add --dry-run|more

# really add it
bzr add

# commit the changes
bzr commit -m "clean commit of branch"

check everything is still OK