If I start out with a local mercurial repo, which I consider to be the "main" repo (pardon me my dvcs lords), and intend to use bitbucket as a backup and issue tracking facility, I can do all my changes in my local repo and do an "hg push" to send the changes back to bitbucket.
Don't I need to follow this "hg push" command run on my local machine with an "hg update"?
Why do you care what's in the working directory on BitBucket's servers? As long as you push the changes will be in the repository and visible on the BitBucket page.
EDIT: OK, I'm going to edit this to be a useful answer.
Say you clone down one of my repositories like django-hoptoad on BitBucket. You'll have a folder named
django-hoptoad
on your local machine and its content will look something like this:All the data about the repository itself is stored in the
.hg/
folder. That's where Mercurial keeps the data about which files were changed in which changesets, and lots of other stuff.You can think of it like this (though it's an oversimplification):
When you run
hg pull
and don't update, you pull any new changesets into the repository:If you don't update, the
... my code and other folders
will still be equivalent to whatever is inchangeset 2
, but the other changesets are still in the repository.When you run
hg update
Mercurial will update the... my code and other folders
to the contents of the newest changeset.Really, this means that what happens to be in
... my code and other folders
doesn't have to match what's in the repository. You could just delete it and all the changesets would still be in the repository:If you committed right now, it would create a new changeset that basically says "no files". You don't have to commit though. People can still push and pull from you because the repository still has all the data about the changesets.
This is almost certainly what BitBucket is doing. You're never going to log in to BitBucket's servers, edit your code and commit there -- you're only ever going to push/pull/clone. That means the
... my code and other folders
will never actually be used, so I'd imagine Jesper has it set up to delete it to save the disk space.Since
hg update
only really affects the working directory, and the working directory on BitBucket is never used, you don't need to runhg update
after you push to BitBucket.I think you might be getting confused between the working copy (aka working directory) and the local repository. These are related but separate things. The local repository contains the full history of all tracked files whereas the working copy contains versions of the files from a particular revision plus your changes to them,
The
hg
commandpush
andpull
move changes between repositories andupdate
andcommit
moves changes between your working copy and your local repository.So if you
push
changes to a remote repository that will not change the local repository and so there's no need to run anupdate
on the local repository. However, anyone using the remote repository will need to do anupdate
so your changes are shown in their working copy. Conversely, if youpull
changes from a remote repository you will need to do anupdate
so that these changes are shown in your working copy.Similarly, you need to
commit
all changes from your working copy into the local repository before they can be sent to another repository usingpush
.No need to do a hg update on your local machine. Update is used when data is pushed TO your local repository, and you are pushing FROM your local repository.
Bitbucket shows you the repository. As pointed out by Dave Webb,
hg update
is concerned with updating the working copy. When you dohg push
you are transferring changesets in order to update the repository on Bitbucket -- and so the webinterface will show this.There are no working copies on Bitbucket, as pointed out by Steve Losh. There is also no
hg update
being done behind your back.You can experiment with this yourself by making a clone without a working copy:
then go into
repo-empty
and dohg log
. You will see that even though there are no files there, the history (i.e., the repository) has still been cloned. You can make the files appear with thehg update
command:and disappear again with
The working copy is only needed if you want to look at the files and make new commits. Otherwise you can remove it to save space. This is normally done in clones that are only used for serving with
hg serve
or the equivalent thing that Bitbucket uses.