I'm working with clearcase 8.0.1.17
I removed a directory containing 4 other directory with multiples files :
DirA
DirA1 (5 files)
DirA2 (10 files)
DirA3 (4 files)
DirA4 (15 files)
I checked in this and made a baseline. Now I want to recover DirA with only DirA2. I recreated both directory with the 10 files from my backup but I've lost all the versions trees.
How can I do to recover version trees ?
You cannot just recreate the folder/files, or you would create evil twins (elements with the same name but different history/version tree): you can list evil twins here.
You need to delete your new elements, and open the version tree of the parent folder of DirA.
You will see a version tree like:
n-3 (list DirA)
n-2 (delete DirA)
n-1 (import new DirA folder: evil twins)
n (delete DirA again)
You can then merge the n-3 version (which listed DirA) to the current (where you deleted DirA)
That will restore the subfolder entry DirA.
Repeat that for version tree of DirA itself (that will restore the DirAx folder entries)
Full details in "How to restore an element that has been rmnamed", but here the idea is: do that for the folders first.
Then the files if needed.
See also "Undo remove file in ClearCase", using cleartool ln.
Related
I need to put under version control sparse files.
I mean files like:
/etc/hosts
/opt/Sybase/config.ini
/usr/local/httpd/conf/httpd.conf
They are sparse in the sense that they are not in one single folder.
Git usually works in a single folder. Other version control tools do the same.
I need to put these files under version control because I need to track the entire configuration of a server.
Fossil allow to add single file and do not track the whole dir of it
Somehow tricky, but
Create new repo (or repos, if you have more than 1 LT in next step)
Define common base dir(s) for your files - it will be place of "permanent" Local Tree (common dir is important, because Fossil doesn't allow add files to repooutside open tree)
Open repo in this CommonBase
Add files
Commit
After it you can open repo in any other location into "working" Local Tree, get all files in it, edit-commit, but don't forget "update" after commits your "permanent" Local Tree
HTH
I have a certain folder(named SDK) containing many other folders as a VOB element in my dynamic view.
/vobs/tools/SDK
I also have a updated version of that folder elsewhere as view private (as flat files).
/homes/user/SDK
I need to add files which were introduced in the updated version to the checked in version which did not have them. I have a text file containing all the files which were newly introduced in the updated version.
/homes/user/files.txt
Contents of files.txt
./a/b/abc.cpp
./s/t/xyz.cpp
.
.
.
Which is the best way to have these files checked in at at appropriate location?
clearfsimport will not work because it takes the leaf of the source path and checks that at the target VOB location.
i.e.
clearfsimport -nset /homes/user/SDK/a/b/abc.cpp /vobs/tools/SDK
clearfsimport -nset /homes/user/SDK/s/t/xyz.cpp /vobs/tools/SDK
wouldn't create the /a/b/ and /s/t/ directories in /vobs/tools/.
I could use mkelem but that would require me to manually create the directory /a/ then /a/b/ and then copy the file abc.cpp and checkin back the newly created directories and the file itself.
Can someone suggest the most efficient way of doing it?
Yet clearfsimport should work (to import multiple files):
clearfsimport -preview -rec -nset /homes/user/SDK /vobs/tools/SDK
# or
clearfsimport -preview -rec -nset /homes/user/SDK/\* /vobs/tools/SDK
That should import all elements, but checkout and update only the ones modified, and create the one missing.
All that in /vobs/tools/SDK, not /vobs/tools.
Since there are too many files in /vobs/tools/SDK, copy the ones which have been modified in /vobs/tools/SDK_to_import, with their exact folder structure (like /homes/user/SDK_to_import/a/b/abc.cpp).
The clearfsimport, by default, will not remove the files of the destination folder which are not present in the source folder.
But it will update those files in the destination folder /vobs/tools/SDK.
I'm using Github for Windows together with NetBeans IDE. How do I export files from one revision to another in git? I can see the revisions and what files are there and there is an option to export a specific revision, but I want to export modifications between two revisions.
I basically want files that is modified/changed from revision 2 to revision 5 revision exported to a temporary folder. Is this possible? I could of course export each commit but that's seems so wrong...
You could simply:
list all modified files (based on this solution)
git diff --name-status [SHA1 [SHA2]]
copy all the modified files from that list to a temporary folder.
If another developer adds a new directory to the CVS repository, I'd like my next update to bring this new directory into my working copy. Running cvs update doesn't do this. Running cvs update -d does, but it takes a helluva long time; it prints the pathname of every file in the repository and spends a little time thinking about each one. Running cvs update -d <dirname> in the new directory's parent does the job, but I have to know about the new directory first, and I have to do this for every new directory.
Is there an efficient way to get a complete update, including any newly-added directories, from a CVS server?
Use a shell script which generates a custom $CVSIGNORE list for this type of update, then runs cvsupdate -d to do this:
CVS has a list of files (or sh(1) file name patterns) that it should ignore while running update, import and release. This list is constructed in the following way.
The list is initialized to include certain file name patterns: names associated with CVS administration, or with other common source control systems; common names for patch files, object files, archive files, and editor backup files; and other names that are usually artifacts of assorted utilities. Currently, the default list of ignored file name patterns is:
RCS SCCS CVS CVS.adm
RCSLOG cvslog.*
tags TAGS
.make.state .nse_depinfo
*~ #* .#* ,* _$* *$
*.old *.bak *.BAK *.orig *.rej .del-*
*.a *.olb *.o *.obj *.so *.exe
*.Z *.elc *.ln
core
The per-repository list in ‘$CVSROOT/CVSROOT/cvsignore’ is appended to the list, if that file exists.
The per-user list in ‘.cvsignore’ in your home directory is appended to the list, if it exists.
Any entries in the environment variable $CVSIGNORE is appended to the list.
Any ‘-I’ options given to CVS is appended.
As CVS traverses through your directories, the contents of any ‘.cvsignore’ will be appended to the list. The patterns found in ‘.cvsignore’ are only valid for the directory that contains them, not for any sub-directories.
In any of the 5 places listed above, a single exclamation mark (‘!’) clears the ignore list. This can be used if you want to store any file which normally is ignored by CVS.
References
Ignoring files via cvsignore
I'm working on an Android game with the folder structure:
\bin
\data (contains game graphics)
\libs (libgdx engine jars)
\src
----\com
--------\brand
------------\game
(*.class files)
Foolishly, I created a mercurial repository (hg init) in the \src directory. Thus, if I update any of the graphics (small file sizes), they aren't added to the repo when I commit. My question is: how can I change the root of the repo to include the \data directory as well as the \src directory, but without including the \libs directory as that includes 10-20mb jars?
There are two ways to do this.
1) Start a new repo. It's quick and easy but you'll lose your history.
2) Use hg rename. This is effectively a move command.
Rename the src directory to be something meaningful and then do this.
hg rename MyProject/com MyProject/src/com
Copy all the files/folders into the MyProject/ directory.
Mark bin and libs as ignorable and
Add everything else.
hg commit
If you don't want to just do an hg rename, you can do it with the convert extension (which comes by default with Mercurial, you just need to enable it in your .hgrc).
Run it with the --filemap parameter and a filemap file that has something like:
rename com src/com
You will end up with a new repository with all of your history, but with your com directory moved into src/com. You can then copy you bin, data and libs folders in there, run hg addremove and you should be all good to go.
Warning: the new repo is completely different than the old one -- changeset IDs and such will be different, so anybody you worked with in the past will have to get on the new repo.