3

I got a warning like this

abort: unsynced remote changes!

How do I 1) See what's the difference? hg diff? hg status? 2) Harmonize the code?

Thanks in advance. Here's what I got running hg inspecting the heads

$ hg heads
ändring:     192:e571b17295e9
märke:       tip
förälder:    175:f50d4c4461e5
användare:   tekniklas
datum:       Sat Jan 08 04:45:07 2011 +0000
kortfattat:  twitter support added

ändring:     191:9e419ce3e7e1
användare:   tekniklas
datum:       Wed Mar 09 12:56:27 2011 +0000
kortfattat:  adsense maps

ändring:     159:f8d974793b12
förälder:    157:ef1d955b9236
användare:   tekniklas
datum:       Sat Dec 18 17:05:45 2010 +0000
kortfattat:  remove

ändring:     89:008a2ac46b4f
användare:   tekniklas
datum:       Sun Aug 01 07:10:40 2010 +0000
kortfattat:  classifiedsmarket/market/market_ad_preview.html

ubuntu@ubuntu:/media/Lexar/montao$ 
Niklas Rosencrantz
  • 25,640
  • 75
  • 229
  • 424

2 Answers2

4

You have to pull latest changes before pushing:

hg pull

To view differences before pull:

hg in

After pull you have to merge changes you've pulled with the changes you're trying to push:

hg merge

After merge you'll have to commit your merge:

hg commit

And finally push without errors:

hg push
javanna
  • 59,145
  • 14
  • 144
  • 125
  • Thanks! What if I want to dismiss the changes and keep the branch I do? I namingly found a change I already did other way. – Niklas Rosencrantz Mar 05 '11 at 16:41
  • You're welcome. If the change you already did is in the same file, you can merge it preserving only your changes. Otherwise after pull, merge and commit you can reverse the effect of the older commit with "hg backout -r revision_number". If you want to discard all remote changes without merging them you can also use hg push -f but this is a bad practice that creates a new remote head. – javanna Mar 05 '11 at 17:16
  • I understand. I used hg push -f and thus created a new head. Now I want to clean up.. – Niklas Rosencrantz Mar 09 '11 at 16:48
  • 1
    Hi, to clean up I think you should use hg backout but your situation is not too easy :-) . You should take a look here: http://hgbook.red-bean.com/read/finding-and-fixing-mistakes.html . – javanna Mar 10 '11 at 13:26
3

Just do a

hg incoming

You will see the list of changes that are available in the remote side

javanna
  • 59,145
  • 14
  • 144
  • 125
tamizhgeek
  • 1,371
  • 3
  • 13
  • 25