We decided to switch the source control of our .NET project from SourceSafe to Mercurial.
Now the question is that if there any possibility to know what file from the solution is "extracted"(checked out) and if yes, by whom?
We decided to switch the source control of our .NET project from SourceSafe to Mercurial.
Now the question is that if there any possibility to know what file from the solution is "extracted"(checked out) and if yes, by whom?
"Checking out" used to indicate that nobody else should modify that file. This is more generally known as locking, but it is no longer the basis for how a VCS system works; modern systems can merge changes line-by-line, and provide interactive help in the rare cases where changes conflict. (I was skeptical when I first heard about it, but really it works very well).
In Mercurial, each user has their own clone of the repository. I assume your organization also has set up a "central" repository that everyone synchronizes with. Sitting at your workstation, use hg incoming
to find out whether someone else has pushed changes to the central server that you do not have yet. But you will only see changes that have been "pushed" to the central repository. In mercurial, users can check in changes to their local clone multiple times, and they remain private until they're "pushed" to the central repo. So you can't ask who is planning to modify a certain file, only who has already submitted modifications.
(Caveat: This leaves out a lot of details. Study the mercurial book to learn how the system works, and how to use it to best advantage).
That said, mercurial does have file locking; it is provided by the LockExtension. You can configure certain types of files to require locking; other users can see if a file is locked, and are prevented from pushing changes to it (unless they "steal" your lock, which they're allowed to do since you might lock a file and go on vacation).
Finally: In the comments you mention some kind of file that should never be worked on by more than one person. In mercurial terms, this is a file for which changes should never be merged. This is most often the case with image files and other so-called "binary" formats. The mercurial way to deal with them is not by locking, but by preventing tools from incoherently "merging" two binary modifications. You'd do this by setting your [merge-patterns]
configuration to treat your special files as "binary"; see this question to get the general idea.
In short: You can have locks if you really want them, but there are far better ways to manage your team's collaboration. Learn to take advantage of them and you might not need locks at all.
Files are not "checked out" as such in mercurial, rather, mercurial tracks the files in its staging area (locally). If you run hg status
from the terminal. It will show you the currently modified files that it is tracking as well as any files that it doesn't know about.
So, when you commit, it will commit the tracked files that have been modified. To add untracked files to the staging area, you can add all untracked files with hg add .
You don't need to worry about checking a file out, mercurial knows what you've changed.
As you are using Visual Studio, you could install a plugin (something like this) which would integrate Mercurial with the IDE and display different icons in the solution explorer for modified files
No, Mercurial is decentralized source control. There is no way to reliably know what others might have checked out.
Perhaps you could build something with hooks, but I'd recommend against it. You probably will end up having trouble maintaining such a solution, and it would be brittle because hooks can be disabled locally.
No, Mercurial doesn't have "Lock/Unlock" model totally, only Branch/Merge. Merging isn't problem totally, it may have only some downsides if binary artifacts have to be merged during process (and storing such type of objects in SCM is anti-pattern anyway).
For DVCS situation with locking is even worse, than in CVCS - because every workspace have own copy of repository, independent from others, it's just impossible to check and detect state of some file in all clones.
If changeable binary objects in repository are a must for your workflow and you can't avoid it, you can think about two (different) things:
The Mercurial LockExtension conceptually offers what you are looking for but I am not sure it is ready for prime time. I have not been able to get it to function with a central repository.