mirror of
https://github.com/facebook/sapling.git
synced 2024-10-12 09:48:05 +03:00
2e0e2f49f6
Summary: There are cases when a local repo communicates to another local repo where one of the repos has remotenames enabled and the other does not that lead to crashes. We fix these cases by checking repo objects for _remotenames before accessing that member variables. Differential Revision: D7023300 fbshipit-source-id: e4df06671bfb8291f50c01b53750ccaa3f9df968
74 lines
1.3 KiB
Perl
74 lines
1.3 KiB
Perl
Set up global extensions
|
|
$ cat >> $HGRCPATH <<EOF
|
|
> [extensions]
|
|
> rebase=
|
|
> EOF
|
|
|
|
Create a repo without remotenames
|
|
$ hg init off
|
|
$ cd off
|
|
$ echo a > a
|
|
$ hg ci -qAm a
|
|
$ cd ..
|
|
|
|
Clone repo and turn remotenames on
|
|
$ hg clone off on
|
|
updating to branch default
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
$ cat >> on/.hg/hgrc <<EOF
|
|
> [extensions]
|
|
> remotenames=
|
|
> EOF
|
|
|
|
Ensure no crashes when working from repo with remotenames on
|
|
$ hg -R off bookmark foo
|
|
$ cd on
|
|
|
|
$ hg pull
|
|
pulling from $TESTTMP/off
|
|
searching for changes
|
|
no changes found
|
|
|
|
$ hg push --to bar --create
|
|
pushing rev cb9a9f314b8b to destination $TESTTMP/off bookmark bar
|
|
searching for changes
|
|
no changes found
|
|
exporting bookmark bar
|
|
[1]
|
|
|
|
$ hg pull --rebase
|
|
pulling from $TESTTMP/off
|
|
searching for changes
|
|
no changes found
|
|
|
|
$ cd ..
|
|
|
|
Check for crashes when working from repo with remotenames off
|
|
$ cd off
|
|
|
|
$ hg pull ../on
|
|
pulling from ../on
|
|
searching for changes
|
|
no changes found
|
|
|
|
$ cat >> .hg/hgrc <<EOF
|
|
> [paths]
|
|
> default = $TESTTMP/on
|
|
> EOF
|
|
|
|
$ hg pull
|
|
pulling from $TESTTMP/on
|
|
searching for changes
|
|
no changes found
|
|
|
|
$ hg push
|
|
pushing to $TESTTMP/on
|
|
searching for changes
|
|
no changes found
|
|
[1]
|
|
|
|
$ hg pull --rebase
|
|
pulling from $TESTTMP/on
|
|
searching for changes
|
|
no changes found
|