Fetch and share don't mesh well
Tony Mechelynck
antoine.mechelynck at gmail.com
Sun May 23 22:47:40 UTC 2010
Using Mercurial 1.3.1 as distributed with openSUSE Linux 11.2
fetch and share extensions enabled
Using "hg fetch" one one of the shared repos fetches any new changesets
(on all branches) but doesn't update or merge changesets for a branch
other than the one current for the current repo. Then trying to fetch
from a different repo will fail. The solution I found (but not a pretty
one) is to rollback the fetch done from the "wrong" repo then do it
again from the "right" one.
Here is an example (adding numbers to the shell commands for reference;
repo "vim72" is currently updated to the default branch, repo "vim" to
the "vim73" branch with a few local changes; ui.verbose is set to true
in my ~/.hgrc):
1) linux:~/.build/vim/vim-hg/vim72 # (date && hg fetch --switch-parent)
2>&1 |tee -a ../hg-vim.log
Sun May 23 14:56:21 CEST 2010
pulling from https://vim.googlecode.com/hg/
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files (+1 heads)
linux:~/.build/vim/vim-hg/vim72 # hg tip
changeset: 2209:0e0e99d1092e
branch: vim73
tag: tip
parent: 2207:7d3cf4693a8f
user: Bram Moolenaar <bram at vim.org>
date: Sun May 23 12:06:58 2010 +0200
files: src/netbeans.c
description:
Fix for Netbeans on MS-Windows not compiling.
2) linux:~/.build/vim/vim-hg/vim72 # cd ../vim
3) linux:~/.build/vim/vim-hg/vim # (date && hg fetch --switch-parent)
2>&1 |tee -a ../hg-vim.log
Sun May 23 14:59:24 CEST 2010
abort: working dir not at branch tip (use "hg update" to check out
branch tip)
4) linux:~/.build/vim/vim-hg/vim # hg up
abort: crosses branches (use 'hg merge' or 'hg update -C')
5) linux:~/.build/vim/vim-hg/vim # cd ../vim72
6) linux:~/.build/vim/vim-hg/vim72 # hg rollback
rolling back last transaction
7) linux:~/.build/vim/vim-hg/vim72 # cd ../vim
8) linux:~/.build/vim/vim-hg/vim # (date && hg fetch --switch-parent)
2>&1 |tee -a ../hg-vim.log
Sun May 23 15:00:40 CEST 2010
pulling from https://vim.googlecode.com/hg/
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files (+1 heads)
resolving manifests
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
merging with 2209:0e0e99d1092e
resolving manifests
getting src/netbeans.c
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
src/netbeans.c
new changeset 2210:07995ce62408 merges remote changes with local
At step 3, couldn't the fetch have seen that "the other side" had done a
pull and continue with the merge & commit, instead of suggesting an
"update" which didn't work?
The reason I enabled the fetch extension was in order to avoid the
three-step pull-merge-commit operation, but apparently with shared
repositories it doesn't work (as AFAIK it is not possible to know in
advance which branch(es) of the remote repo have received new changesets)
Best regards,
Tony.
--
The Army has carried the American ... ideal to its logical conclusion.
Not only do they prohibit discrimination on the grounds of race, creed
and color, but also on ability.
-- T. Lehrer
More information about the Mercurial
mailing list