stuck in commit/update/push/pull loop
Matt Mackall
mpm at selenic.com
Tue Dec 20 06:09:43 UTC 2011
On Mon, 2011-12-19 at 17:29 -0700, Steve Franks wrote:
> Can anyone look at the following and see what, precisely, I'm doing wrong?
>
> I'm trying to migrate from bzr which has truly atrocious tool support
> (ever seen how feature poor bzr qlog is?), but the explicit push/pull
> (vs. it being wrapped in commit/update) is rather hampering adoption.
> I'm generally a fan of explicit actions, but I'm starting to get the
> impression hg's achilles heel is located therein (whereas bzr was
> overly fond of trashing my local repository and forcing a clean
> clone).
>
> Perhaps the issue is commit won't act on deleted items without some
> switch being specified?
>
> fwiw: hg --version: 1.6.3
This is a bit old, but works fine.
> Thanks,
> Steve
>
> steve at wynde:~/projects/clients/zonge/manufacturing$ hg push
> pushing to ssh://192.168.0.2//raincloud/hg/zonge/manufacturing
> searching for changes
> abort: push creates new remote heads on branch 'default'!
> (you should pull and merge or use push -f to force)
Ok, let's pull..
> steve at wynde:~/projects/clients/zonge/manufacturing$ hg pull
> pulling from ssh://192.168.0.2//raincloud/hg/zonge/manufacturing
> searching for changes
> adding changesets
> adding manifests
> adding file changes
> added 1 changesets with 5 changes to 5 files (+1 heads)
> (run 'hg heads' to see heads, 'hg merge' to merge)
Ok. Let's try merge...
> steve at wynde:~/projects/clients/zonge/manufacturing$ hg merge
> abort: outstanding uncommitted changes (use 'hg status' to list changes)
Ok. Mercurial refuses to merge dirty working directories because changes
could be lost. So let's go ahead and run status as suggested...
> steve at wynde:~/projects/clients/zonge/manufacturing$ hg commit -m"WTF"
> nothing changed
Huh? It told you to check status. Why would you EVER commit changes
without knowing what the changes were? That's just asking for pain.
Luckily you've found the one kind of change Mercurial will refuse to
commit.
> steve at wynde:~/projects/clients/zonge/manufacturing$ hg update
> abort: crosses branches (use 'hg merge' to merge or use 'hg update -C'
> to discard changes)
Ok, now you're just guessing. But it gives a useful hint that we'll come
back to. FYI, Mercurial refuses to update here because people who update
when they need to merge invariably say "uh, where did my changes go"
because they don't realize they've left a head behind.
> steve at wynde:~/projects/clients/zonge/manufacturing$ hg merge
> abort: outstanding uncommitted changes (use 'hg status' to list changes)
Second time's the charm? I guess so, since you finally run status..
> steve at wynde:~/projects/clients/zonge/manufacturing$ hg status
> ! 335_ZenHub6/Z3Hub6Bom.xls
> ! 335_ZenHub6/Z3Hub6BottomPlace.pdf
> ! 335_ZenHub6/Z3Hub6Brd335.zip
> ! 335_ZenHub6/Z3Hub6PnP.xls
> ! 335_ZenHub6/Z3Hub6PnPBottom.prn
> ! 335_ZenHub6/Z3Hub6PnPTop.prn
> ! 335_ZenHub6/Z3Hub6Sch.pdf
> ! 335_ZenHub6/Z3Hub6TopPlace.pdf
[...]
What does '!' mean? 'hg help status' says:
The codes used to show the status of files are:
M = modified
A = added
R = removed
C = clean
! = missing (deleted by non-hg command, but still tracked)
? = not tracked
I = ignored
= origin of the previous file listed as A (added)
So we have a bunch of missing files(!), as distinct from (R)emoved
files. These files were deleted without telling hg and now it's upset.
It can't tell whether you meant to delete them or it was an accident, so
it will refuse to commit (thus accidentally losing your files) or merge
(thus accidentally keeping your files). The '!' here is not just for
looks, it's really trying to get your attention (and failing).
> steve at wynde:~/projects/clients/zonge/manufacturing$ hg commit -m"rm
> obsolete items"
> nothing changed
Been there, done that.
> steve at wynde:~/projects/clients/zonge/manufacturing$ hg update
> abort: crosses branches (use 'hg merge' to merge or use 'hg update -C'
> to discard changes)
Here's our hint again: 'hg update -C to discard changes'.
I bet you a nickel that'll get you unstuck. But then so would actually
running 'hg rm' on the missing files, committing your changes, then
merging.
--
Mathematics is the supreme nostalgia of our time.
More information about the Mercurial
mailing list