The Plastic SCM GUI

What's a workspace? What's a repository?

Ok, so you already know Plastic is made of servers and clients, but you'd like to know what a repository and workspace are. Let's go!

When you code, you have a copy of your sources in a certain directory, right? You make changes there, build your project, test it, run unit tests, and so on. That's your workspace. A workspace is just a directory where your sources are. As simple as that, with one slight qualification: this directory is under version control with Plastic SCM. When you modify something, Plastic will know. When you add something, Plastic will know. Plastic knows the version of every file and every directory you have in your workspace. Directory versioning allows for this to happen. Directory versioning is powerful and few SCM tools support this capability.

So what's a repository? Remember that the Plastic server stores all your files, directories, and their modifications on databases. Each of these databases is a repository and each of them will normally contain a project. We can argue later about different alternatives, but in order to get started, simply assume every software project you work on will be stored in a different repository.

Your files and directories and their changes are not stored on the server like zip files (as you probably did when you were not using an SCM tool! :-P) but in a relational format. The server and the client have to work together to extract data efficiently from the repository (database) and create a directory structure with files you can work on, AKA your workspace.

So, let's do a really simple experiment, and let me introduce you to some of the most basic actions on the Plastic command line interface before jumping into the GUI. Go to a directory where you have some code and type:

cm mkrep myrepository
cm mkwk myworkspace .
cm switch /main@myrepository
cm add -R *
cm ci

Which means:

  • Create a new repository to store this project (myrepository)
  • Create a workspace called "myworkspace" here.
  • Switch the workspace to the main branch of the repository "myrepository".
  • Add everything inside.
  • Check in everything inside.

Note: Once you create your workspace, check that your directory now has a hidden directory named .plastic. This is where Plastic will store workspace-associated information, the workspace tree (which shows revisions of every file and directory you've loaded), and other internal stuff.

Now try the following: delete everything (except the .plastic hidden dir!) inside your working directory! Don't hesitate, just do it.

Well, now you've lost your code. Hope it was not too terribly important!

I'm kidding! Your code is now safe on the server, in the repository you've created during installation. Go to your workspace directory and type:

cm update .

And you'll see how your beloved code quickly comes back to your directory. What happened here?

Simple: you uploaded your code to the repository, and then you downloaded it back. The Plastic client and server will work together to make this copy as efficient as possible, and will only download the necessary files. Okay, this particular time, you removed the entire thing, so everything will be re-downloaded, but normally you'll just be switching from one version to the next one. That makes this a fast and efficient operation.

Geek point!!! We've worked hard to optimize the client so it will do as few disk reads and disk writes as possible while also taking advantage of your multi-core CPU to speed up the download process, the check-in, and so on. That's why Plastic is faster than other SCMs out there.

Get the latest news