In clearcase If I am working on some file X and want to also see its previous version(say version 5) it is available as X@@/main/5. Is something similar available with other (preferably free) version control systems?
HG has hg cat
and hg co
. but they still do not come close to clearcase's feature above...
Regards
Vijay
views:
156answers:
3A quick Google search found gitfs:
gitfs is a FUSE-based filesystem for working with source trees stored in git repositories. The eventual goal is to provide a convenient way to work with lots of branches and patches. Currently only very basic functionality is implemented -- read-only access to the existing tags and objects.
There are likely other (more active) projects offering similar features (both for Git and other VCSes).
Basically every hg
command you would want to handle an arbitrary revision can - using -r
in hg
is just like using @@
in clearcase all the time. hg
"only" needs -r
because files aren't versioned independently of the repository, so given a file and a repo version, -r
is unambiguous.
If you want to edit a file, piping hg cat
is exactly like reading file@@/branch/ver
- they provide exactly the same (read-only) access to the data.
If you want the convenience of dynamic views over MVFS in Mercurial, that's an entirely different problem and you can't really do it (you can do it read-only over NFS, but obviously there's no versioning there).
First, X@@/main/5
is an extended pathname which you can really explore only in dynamic views.
Second, you can quickly access an older version of a file in Git:
git show REVISION:path/to/file
(with the path of the file being always from the root of the git repository)
And you can use git show for other usage (see the file as it is in another branch for instance)
See "How to retrieve a single file from specific revision in Git?" for more.
In term of dynamic exploration of a revision-based filesystem, the equivalent of hgfs for Git would be:
- gitfs FUSE-based filesystem for working with source trees stored in git repositories.
figfs (the Filesystem Interface to Git FileSystem), which expands on gitfs.
The repository is presented as a filesystem which allows multiple versions and branches of the project code to be viewed simultaneously and without the need to reconfigure the user's workspace.
In order to provide a filesystem service, figfs uses the Filesystem in User space (FUSE)
From the work of Reilly Grant
A FUSE application allows a filesystem to be implemented as a user-space process.
An application’s request is passed through the VFS layer and into the FUSE driver which
sends the request to the user space filesystem daemon.
Figfs then accesses the Git repository through the normal filesystem and returns the resulting data to the application.