octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Pytave - (probably mercurial) - - Question


From: Mike Miller
Subject: Re: Pytave - (probably mercurial) - - Question
Date: Sat, 4 Jun 2016 10:32:27 -0700
User-agent: Mutt/1.6.0 (2016-04-01)

On Sat, Jun 04, 2016 at 22:36:39 +0530, Abhinav Tripathi wrote:
> Thanks Jordi for the detailed info..
> Just a few more doubts please.
> 
> > It goes wherever you're standing.
> >
> > A big difference between git and hg is that in hg commits don't need a
> > reference to "exist".
> 
> Then how do I use those commits. I mean how do I merge them into a bookmark?

I'm not sure what you mean here either. Can you give an example of what
exact commands you would be using in git that you are trying to ask
about here?

It sounds like you've done this

  # edit some files
  hg commit
  hg book mybookmark

Now 'mybookmark' points to the changes you just committed.

> If after 'hg pull' I get that "the divergent bookmark @ has been saved as
> @default" do i need to worry or is it okay?

This means that your repository's '@' bookmark is different from the
bookmark of the same name that you pulled from. This is kind of like
remote tracking branches in git, hg does not have any concept of remote
tracking branches.

This means that Alice has pushed a change to her '@' bookmark, and Bob
has pushed a different change to his '@' bookmark, and Bob pulls from
Alice and gets a new bookmark '@alice' to mark the two heads.

> Also if I do 'hg pull' and I get a new bookmark which I need to work on. Do
> i have to do 'hg update' before checking out that bookmark or after that?
> I didn't get the gist of what exactly 'hg update' does?

Yes. `hg pull` is like `git fetch`, it downloads new changes but doesn't
actually change your working directory or your concept of what revision
you are working on. `hg update` is exactly like `git checkout`, it
updates your working revision, and attempts to merge any uncommited
local changes.

In fact `hg checkout` is an alias for `hg update` if you like that
terminology better.

> Yes, sorry I used the words incorrectly. I meant I just wanted those
> commits on my remote repo's bookmark either via a force push or merge.
> Because the remote bookmark already has some commits (which my local repo
> doesn't have) which don't conflict with any of the new commits.
> Do I need to delete the bookmark, pull a fresh copy and then do the commits
> again. Or can I just merge my local bookmark into the remote boomark
> (probably by first pulling and then merging). Both the bookmarks even have
> different names.

This would probably also be clearer if you showed an example of what you
are trying to do in git commands.

It sounds like you are pulling from your repository and getting some
commits with bookmark 'foo'. You have meanwhile committed some local
commits with bookmark 'bar'. Are they separate features that you want to
push separately to be merged by someone else, one set of changes is
independent from the other? Or do you want to either rebase or merge the
new commits such that there is a new commit on 'foo' that includes the
new changes from 'bar'?

Do you want the end result to look like this

  '@' --- o --- o --- 'foo'
     \
       --- o --- 'bar'

or like this

  '@' --- o --- o --- 'foo' --- o
     \                         /
       --- o --- 'bar' -------

or like this

  '@' --- o --- o --- 'foo' --- o --- 'bar'

?

> Also can I just commit one out of 2 modified files?
> 'git add' prepares files for next commit. But as i understand, 'hg commit'
> is only used to add newly created files into repo.
> All the modified files get commited at once. Is there a way to change this
> behavior?

Yes, hg has no concept of a "staging area" like git does. Just use

  hg commit file1 file2 ...

This has actually bitten me several times, especially when amending a
commit and I forget that I had local uncommitted changes.

-- 
mike



reply via email to

[Prev in Thread] Current Thread [Next in Thread]