How to move a module from one CVS repository to another? - repository

Is it possible to move a module from one CVS repository to another not losing the history (including the deleted files)?
I have two CVS repositories and I want to move a module (a top-level sub-directory of the CVS root direcory) from one to the other.
Can I simply move the module directory, or is there something else to do? It seems that CVSROOT directory in the repository's directory does contain some references to the modules.

You should be able to move (or copy) the top level module directory from one repository to another. The history of the module is self-contained.
If you want to maintain any additional behaviour (eg. pre-commit hooks) then you will have to copy the references to the module in the CVSROOT module.

Related

How to keep custom moqui components in a separate directory

Suppose I wish to put my custom components in a directory named 'cc', which will sit next to the 'moqui-trunk' directory.
dev/
|-- cc/
|-- moqui-trunk/
There's a setting in MoquiInit.properties
moqui.runtime=../moqui/runtime
One would ideally think that changing this to ../cc should do the job. But underneath there's another block, which says:
if there is a "runtime" directory in the war file (in the root of the webapp) that will be used instead of this setting
I think if I rename/delete the 'runtime' directory in the 'moqui-trunk' directory, then it would start picking components from my 'cc' directory. But how can I achieve the same with minimum changes in the 'moqui-trunk' (so as to easily manage patches, svn update etc).
I am not following why you would want to move things around but the way I do it is to have three git repos a) Moqui b) Mantle c) Components
Moqui is git cloned to /moqui
Mantle is git cloned to /moqui/runtime/mantle
Components is git cloned to /moqui/runtime/component
In my components is where I have subdirectories for my applications and all this means that I can keep everything clean and as close to upstream as possible and it also means that if you are in /moqui directory you can git pull for upstream Moqui changes and same goes for /moqui/runtime/mantle for Mantle changes.
Also have a look at the Making Apps with Moqui book it really helps explain the basics of building atop of Moqui.

Something strange with Project Paths in IntelliJ 14.1.4

So, something has started to act weird in my intelliJ project. I even tried removing the iml and .idea data, to no avail.
I go to Project Structure. There, I have a content root. Withing, I have three folders - one for my jar (and jni lib), one for Samples and one for Tools (just tools written to use the jar). The jar, Samples and Tools are marked blue (sources).
In the jar folder, I have my source tree (com\company\projectname\XXX), a lib folder, a folder for my JNI lib and a folder I created call 'junit', which is the focus of this question. It is marked in Project Structure in green (Tests).
Within, I have a folder structure eerily similar to my code: com\company\projectname\junit.
When I open a file in junit\com\company\xxx\junit, I have a big red underline under my package com.company.xxx.junit; line which tells me: "Package name 'com.company.xxx.junit' does not correspond to the file path 'junit.com.company.xxx.junit'.
I was under the impression that marking a folder as 'Tests' would instruct the IDE to use that as a "parent" folder, if you will, eliminating the need to prepend another folder name.
How can I separate the code from unit tests and in fact, create two junit test suites (one is for internal use, the other is a 'skeleton' for distribution), park them under one "umbrella" folder and NOT have to prepend the package names with that folder name?
Update: Project structure:
Based on your screen shot, the issue is that the junit directory is a subdirectory of another source directory, namely MyProvider. A source directory (whether a "production" source or a unit test source directory) cannot be a subdirectory of another source directory.
You need to either:
move the junit directory out of MyProvider so it is a sibling directory, or
unmark MyProvider as a source directory, create a main (or some such directory) in MyProvider, mark it as a source directory, and then move the com directory/package into main.
Option 2 would be the preferred way to deal with this as it follows a very common directory structure standard.
UPDATE (Following comment from OP)
Here's a couple of screenshot showing the configuration you desire:
I removed the .IdeaIC15 folder and started over. Working for now. Something must have gotten confused in the config, either as part of the update, or in the course of operation. I have taken a backup copy as it is now, so if this happens again, I will have something to check.

Does libgit2 supports redirect all operations to .git directory?

This article mentioned to redirect objects and refs folder to database, can other files under git repo (.git folder) be redirected in similar way?
libgit2 allows you to replace the default accessors so you don't have to store data in the git-dir, but it does not provide a way to avoid having the git-dir.
The git-dir is where Git stores data about the state of the repository, which includes references, a configuration file and the objects. These are three things which you can ask libgit2 to use a different object instead of the one which does look at the directory as git creates them. This can make those repositories not be compatible with git itself, so it's not a decision to be taken lightly.
But the git-dir also contains an excludes file, the index, hooks, MERGE_HEAD and the other _HEAD files, the temporary files for the commit's message, the rebase's instruction sheet... None of these things are full-blown objects which libgit2 lets you plug in, some of them aren't read by libgit2 at all either.

How do I commit my IntelliJ IDEA Global Library configuration into source code control?

I have IntelliJ IDEA 13.1 running on a number of machines, all with identical paths for the project and modules but different local user names. The .idea directory gets committed to the git repo. When I make changes to my Global Libraries those are not reflected on the other machines because that info is in
C:\Users\user\.IdeaIC13\config\options\applicationLibraries.xml
I want changes to Global Library settings to be required only once and applied everywhere.
Should I tell IDEA to look for applicationLibraries.xml under the .idea directory instead of in the local user's directory which is not under version control? how?
Solution was to go into Project Structure, right click on each Global Library and choose "Copy To Project Libraries..." then remove the original from Global Libraries. Then in each project remove the old global library and add the newly created project library. This way library data is stored in the .idea dir and not the user's dir.
The applicationLibraries.xml file, among others, are stored in a platform-dependent folder in the repo, for example in _linux or _windows. If this is your problem, read on.
For things like keymaps this is wanted because things work differently after all, but for libraries which either only contain jars, or contain binaries (dll/so) for all platforms, this is unwanted.
On the PC with the global libraries (assuming linux for now):
Copy the file from config/settingsRepository/repository/_linux to _windows,
Execute git add _windows/applicationLibraries.xml from the command line,
Restart IntelliJ,
Merge repo (not Overwrite remote)
This solved it for me, and now I have global libraries on all my computers, and not just my linux computers.

How do I export the Bazaar history of a subfolder

I'm coding a framework along with a project which uses this framework. The project is a Bazaar repository, with the framework in a subfolder below the project.
I want to give the framework a Bazaar repository of its own. How do I do it?
You use the split command:
bzr split sub_folder
This creates an independant tree in the subfolder, which you can now export and work on separately.
Use fast-import plugin (http://bazaar-vcs.org/BzrFastImport):
1) Export all your history to the stream:
bzr fast-export BRANCH > full-history.fi
2) Filter the history to produce new stream:
bzr fast-import-filter -i subfolder full-history.fi > subfolder.fi
3) Recreate new branch with subfolder only:
bzr init-repo .
bzr fast-import subfolder.fi
As far as I know, there is not a way to do this easily with bazaar. One possibility is to take the original project, branch it, and then remove everything unrelated to the framework. You can then move the files in the subdir to the main dir. It's quite a chore, but it is possible to preserve the history.
you will end up with something like:
branch project:
.. other files..
framework/a.file
framework/b.file
framework/c.file
branch framework:
a.file
b.file
c.file
As far as I know, "nested" branches are not support by Bazaar yet. Git supports "submodules", which behave similar to Subversion externals.
I have tried doing this with bzr split, however, this does not work how I expect.
The resulting branch still contains the history of all files from all original directories, and a full checkout retrieves all the files. It appears the only thing that split does is convert the repository to a rich root repository so that this particular tree can be of a certain subdirectory only, but the repository still contains all other directories and other checkouts can still retrieve the whole tree.
I used the method in jamuraa's answer above, and this was much better for me as I didn't have to mess with converting to a new repository type. It also meant that full checkouts/branching from that repository only recreated the files I wanted to.
However, it still had the downside that the repository stored the history of all those 'deleted' files, which meant that it took up more space than necessary (and could be a privacy issue if you don't want people to be able to see older revisions of those 'other' directories).
So, more advice on chopping a Bazaar branch down to only one of its subdirectories while permanently removing history of everything else would be appreciated.
Do a
bzr init .
bzr add .
bzr commit
in the framework directory.
Then you can branch and merge to just that directory.
The bazaar higher up will ignore that directory until you do a join.
Bazaar understands when you do things like
bzr branch . mycopy
bzr branch . myothercopy
The current directories .bzr won't track those subdirectories changes.
It saves you from trying to find a place to put a branch.