how to migrate project with whole history into another bzr repository? - bazaar

I have old bazaar repository; now I want to migrate some projects with whole commit history from it into particular nodes in new repository.
How can I do this?

Well, simply push each project checkout to the new repository.
Get your project1 (optional if you already have a local copy)
bzr branch bzr://Path/to/my/Project1
and then push it to the new repository.
bzr push bzr://Path/to/my/new/repository/particular/node/Project1
You can import your project inside a repository (or shared repository) where you want. I assume that's the 'nodes' you speak about ?
Push reference help:
http://doc.bazaar.canonical.com/bzr.2.5/en/user-reference/push-help.html

Related

Pull from one GitLab repository and push into another one

So I have a public repository from my lecturer on GitLab, which I cloned into intellij via "import VCS" (https Link). Now I want to always push into my own repository in GitLab and not the public repository. How can i do this in intellij or where else can I set this up?
I already tried to copy the project into a new project and push seperately but this isnt a good solution because then i need to copy everything manually whenever new things are being added in the public repository and i cant just pull from the public repository.
The optimal solution would be, that i can pull from the public repository but push my commits into my own repository in GitLab
clone the public repository using command
git clone repo_path
git add .
git commit -m "comment"
git push origin main
You can clone your lecturer project.
Once it's done, go to Git | Manage remotes and add your private repostiory there.
Once it is added there, when you decide to Push -> go to Git | Push and then you can click on origin and choose desired remote. This way you can choose your target remote and update your local project from your teacher's repository.

Bzr: Create a shared repository from an existing stand-alone repository

I have been using Bzr for version control of my project over the last few months. I am the sole developer, and currently I just have everything in a single local project directory, to which I commit and which I sync to DriveHQ.
I now have some large-scale experiments in mind which would likely break this main line, so I've been looking into the concepts of branches and shared repositories. So my question is, basically: how should I go about creating a new, shared repository from this already-version-controlled base?
I am familiar with the SVN project structure of trunk, branches and tags, and I'm going to adopt this structure. My plan is to just go ahead and do a fresh init-repo, and copy all my code (plus .bzr) over into the trunk folder. So is this OK? Or is there some way to convert what I have already into a shared repository?
Many thanks in advance for any help.
Christopher
OK, so you have some work directory where your standalone branch is.
You want to create trunk and feature branches in new shared repo.
At first you need to create a shared repository itself:
bzr init-repo /path/to/repo
Now you can put your code to repo/trunk. You can use push, branch or you can copy work and use reconfigure.
cd work; bzr push /path/to/repo/trunk
cd path/to/repo; bzr branch /path/to/work trunk
or copy/move work to /path/to/repo/trunk then cd /path/to/repo/trunk; bzr reconfigure --use-shared
In all cases you'll have branch trunk as a copy of your old work, and this trunk will use shared repository to save the revisions.
You can also look at bzr-colo plugin.
Create a folder outside your current repository.
Call bzr init-repo to create a shared repository
From your working tree push to the newly created shared repo.
You can now work directly on the shared repo

Nexus: removing repository

I accidently removed a hosted snapshot repository from Nexus containing a few artifacts needed by other developers on my team. Fine, I'll be able to recreate it fairly easy, but when I tried to add the repository again with the same name as the one I removed, the "Upload Artifact" tab did not show. I tried to clean the cache and reindex the public and public snapshot repos, but that didn't help. I also tried setting an alternative storage path by entering an alternative path on "Override Local Storage Location", same result.
Will I have to create a brand new repository with a different name and change all repository reference in my projects?
Thanks,
David
You should be able to create the new repo without any problem. It's possible you where inheriting permissions to this repo via a group and when you made the new repo you didn't add it to the group.
Also, all delete operations in Nexus simply move files to the sonatype-work/nexus/trash so you could have just copied all those files back directly on the disk after recreating the repo.
I think I noticed that snapshot repositories do not have the Artifact Upload tab, so possibly you created it as a snapshot repo?

Bazaar offline + branches

I have a Bazaar repository on Host A with multiple branches. This is my main repository.
Until now, I have been doing checkouts on my other machines and committing directly to the main repository. However, now I am consolidating all my work to my laptop and multiple VMs. I need to be working offline regularly. In particular, I need to create/delete/merge branches all while offline.
I was thinking of continuing to have the master on Host A with a clone of the repository on the laptop with each vms doing checkouts of the clone.
Then, when I go offline, I could do bzr unbind on the clone and bzr bind when I am back online.
This failed as soon as I tried to bzr clone since bzr clone only clones a branch(!!!!)
I need some serious help. If Hg would handle this better please let me know (I need Windows support.) However, at this moment I cannot switch from Bazaar as it is too close to some important deadlines.
Thanks in advance!
bzr fundamentally works with one branch / directory (the branch are visible at the file system level), so if you need to clone each branch from your repository (not unlike svn, in a way). Hg, at basic level, works this way too (although you can put several branches in one repository using say named branches).
For DVCS, it is important to distinguish between the following:
Working tree: a versioned set of files (at a given revision)
Branch: a linear set of revisions
Repository: a set of revisions
When you clone locally a directory versioned by bzr, you are copying the repository subset which contains all the revisions in the branch you are cloning, and get the working tree. This assumes you are not asking for a branch wo a working tree nor using a shared repository.
What you want, IIUC, is to clone the full repository with all the branches. There is no 'native' way to do so in bzr I believe, but plugins to help you toward this, like multi-pull and push-repo, to sync multiple branches in one shot.
But I don't understand why that's such a big problem, or the link with working offline: you just clone the branches you want to work on your laptop.

Bazaar: moving from single-developer to an accessible repository

I've started using bazaar DVCS for a project in a single-user mode, as described in their tutorial. I would like to involve another developer in this project, but the multi-user, "brancheable" repository seems to have different structure from my little ad-hoc directory. I can't find the documentation on how to go from one to the other. Can someone help?
I don't see how you managed to get something that's not branchable. It's a fundamental thing in bazaar.
Suppose you have done something like this for your code:
c:\dev> bzr init proj
c:\dev\proj> hackhackhack.bat
c:\dev\proj> bzr commit
This should be a branchable repository. i.e.
c:\dev2> bzr init-repo .
c:\dev2> bzr branch c:\dev\proj proj
You now have a branch.
If you're talking about running the built-in server, you need to do this:
c:\dev2> bzr serve