views:

52

answers:

1

Using Mercurial, we can commit one file by using

hg commit file.rb

or 1 folder

hg commit foldername

But how can we push just 1 file or 1 folder out?

The whole project can be pushed using

hg push ssh://[email protected]//project/code/preliminary

but there seems to be no way to push out just 1 file or 1 folder?

I tried the following and they don't work:

hg push ssh://[email protected]//project/code/preliminary app/views/index.html.erb

or

hg push ssh://[email protected]//project/code/preliminary/app/views/index.html.erb
+2  A: 

That's not really possible to do with Mercurial. The whole point of Mercurial (and Subversion and git and pretty much every version-control system since CVS) is that you deal with changesets; each commit is a set of changes to one or more files. push and pull only know about commits, not about each part of every commit.

clee
wait a second... i think from reading hginit.com, it is said that using hg, we can commit as often as we want, so as to keep incremental / gradual revisions... so what if we work on 2 parts of the project, and one part we keep on committing but not fully working, and the second part we also keep on committing, and now working and we want it pushed? Then both part 1 and part 2 have to be pushed together?
動靜能量
actually with Subversion, we can commit just 1 file or 1 folder... so I am look at this from the point of view of "from the local machine to a central repository"... so SVN really can do that...
動靜能量
In that case, you should be doing your work in two different branches, or possibly two different checkouts. You can use 'hg outgoing' to see which commits 'hg push' will send upstream.It sounds like you're intermingling feature1 commits with feature2 commits and you want to cherry-pick which ones to send; unfortunately, that's a little tricky to do with hg, and would take more characters than I can fit in this little box. :)
clee
Subversion isn't distributed like hg and git, so yes, you can *commit* one file or folder at a time, but there is a difference between what 'commit' does and what 'push' does. Anyway, if you're convinced that you want to stick with hg, you should check out 'hg bundle' and 'hg unbundle'.
clee