annotate tests/test-import.t @ 1209:fa35aeb64d32 stable

evolve: prevent a crash in httpclient_pushobsmarkers() when pushing I've been running into a crash when pushing from my hg repo in a Fedora 16 VM to Win7 running 'hg serve', even with extensions disabled on both sides: ../hg push -r . pc pushing to http://192.168.1.4:8000/ searching for changes no changes found pushing 2 obsolescence markers (263 bytes) ** unknown exception encountered, please report by visiting ... File "hg-evolve/hgext/evolve.py", line 2482, in _pushobsolete remote.evoext_pushobsmarkers_0(obsdata) File "hg-evolve/hgext/evolve.py", line 2522, in httpclient_pushobsmarkers ret, output = self._call('evoext_pushobsmarkers_0', data=obsfile) ValueError: too many values to unpack I'm not sure how this repo differs from the one in the test suite, so I'm not sure how to craft a test for this. The failure occurs even when there _are_ csets to push. There was no crash if no obsolete markers needed to be pushed. At any rate, this code was stolen from httppeer._callpush(), where it calls self._call(). The socket exception handling wasn't necessary to fix the crash, but the calling code might as well be duplicated in its entirety. A successful push with this patch looks like this. Note the final line is _not_ in the output of the http push in test-simple4server.t: ../hg push -r . pc pushing to http://192.168.1.4:8000/ searching for changes remote has heads on branch 'default' that are not known locally: 3af110194a0c 56000e3ae44d 57ac6e51d290 7da4355c21b8 and 8 others remote: adding changesets remote: adding manifests remote: adding file changes remote: added 1 changesets with 0 changes to 1 files (+1 heads) pushing 4 obsolescence markers (525 bytes) remote: 2 obsolescence markers added
author Matt Harbison <matt_harbison@yahoo.com>
date Thu, 05 Mar 2015 20:02:07 -0500
parents cc3e68120185
children 9f42f819267b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
930
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
1
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
2 This feature requires mercurial 3.0
984
b286f77d680c tests: fix grammar, spelling, punctuation in comments
Greg Ward <greg@gerg.ca>
parents: 951
diff changeset
3 (and the `only()` revset is 3.0 specific)
930
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
4
951
e3f7258d05d5 test: fix test-import condition
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 930
diff changeset
5 $ (hg help revset | grep '"only(' > /dev/null) || exit 80
930
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
6
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
7 Test creation of obsolescence marker by path import
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
8
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
9 $ hg init auto-obsolete
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
10 $ cd auto-obsolete
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
11 $ echo '[extensions]' >> $HGRCPATH
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
12 $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext/evolve.py" >> $HGRCPATH
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
13 $ echo A > a
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
14 $ hg commit -Am A
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
15 adding a
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
16 $ echo B > b
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
17 $ hg commit -Am B
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
18 adding b
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
19 $ hg up '.^'
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
20 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
21 $ echo C > c
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
22 $ hg commit -Am C
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
23 adding c
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
24 created new head
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
25 $ hg log -G
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
26 @ changeset: 2:eb8dd0f31b51
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
27 | tag: tip
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
28 | parent: 0:f2bbf19cf96d
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
29 | user: test
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
30 | date: Thu Jan 01 00:00:00 1970 +0000
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
31 | summary: C
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
32 |
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
33 | o changeset: 1:95b760afef3c
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
34 |/ user: test
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
35 | date: Thu Jan 01 00:00:00 1970 +0000
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
36 | summary: B
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
37 |
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
38 o changeset: 0:f2bbf19cf96d
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
39 user: test
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
40 date: Thu Jan 01 00:00:00 1970 +0000
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
41 summary: A
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
42
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
43
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
44 (actual test)
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
45
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
46 $ hg export 'desc(B)' | hg import - --obsolete
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
47 applying patch from stdin
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
48 $ hg log -G
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
49 @ changeset: 3:00c49133f17e
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
50 | tag: tip
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
51 | user: test
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
52 | date: Thu Jan 01 00:00:00 1970 +0000
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
53 | summary: B
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
54 |
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
55 o changeset: 2:eb8dd0f31b51
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
56 | parent: 0:f2bbf19cf96d
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
57 | user: test
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
58 | date: Thu Jan 01 00:00:00 1970 +0000
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
59 | summary: C
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
60 |
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
61 o changeset: 0:f2bbf19cf96d
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
62 user: test
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
63 date: Thu Jan 01 00:00:00 1970 +0000
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
64 summary: A
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
65
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
66 $ hg debugobsolete
1065
f355bbc124fc test: update test to new date formatting in debuobsolete output
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 984
diff changeset
67 95b760afef3c234ffb3f9fd391edcb36e60921a4 00c49133f17e5e5a52b6ef1b6d516c0e90b56d8a 0 (*) {'user': 'test'} (glob)
930
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
68
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
69 $ hg rollback
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
70 repository tip rolled back to revision 2 (undo import)
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
71 working directory now based on revision 2
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
72 $ hg log -G
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
73 @ changeset: 2:eb8dd0f31b51
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
74 | tag: tip
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
75 | parent: 0:f2bbf19cf96d
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
76 | user: test
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
77 | date: Thu Jan 01 00:00:00 1970 +0000
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
78 | summary: C
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
79 |
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
80 | o changeset: 1:95b760afef3c
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
81 |/ user: test
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
82 | date: Thu Jan 01 00:00:00 1970 +0000
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
83 | summary: B
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
84 |
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
85 o changeset: 0:f2bbf19cf96d
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
86 user: test
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
87 date: Thu Jan 01 00:00:00 1970 +0000
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
88 summary: A
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
89
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
90 $ hg debugobsolete
cac35bef8aee import: --obsolete flag for automatic obsolescence marker creation
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
91