Show More
@@ -0,0 +1,154 b'' | |||||
|
1 | #testcases obsstore-off obsstore-on | |||
|
2 | ||||
|
3 | $ cat << EOF >> $HGRCPATH | |||
|
4 | > [extensions] | |||
|
5 | > amend = | |||
|
6 | > EOF | |||
|
7 | ||||
|
8 | #if obsstore-on | |||
|
9 | $ cat << EOF >> $HGRCPATH | |||
|
10 | > [experimental] | |||
|
11 | > evolution.createmarkers = True | |||
|
12 | > EOF | |||
|
13 | #endif | |||
|
14 | ||||
|
15 | Prepare parent repo | |||
|
16 | ------------------- | |||
|
17 | ||||
|
18 | $ hg init r | |||
|
19 | $ cd r | |||
|
20 | ||||
|
21 | $ echo a > a | |||
|
22 | $ hg ci -Am0 | |||
|
23 | adding a | |||
|
24 | ||||
|
25 | Link first subrepo | |||
|
26 | ------------------ | |||
|
27 | ||||
|
28 | $ echo 's = s' >> .hgsub | |||
|
29 | $ hg add .hgsub | |||
|
30 | $ hg init s | |||
|
31 | ||||
|
32 | amend without .hgsub | |||
|
33 | ||||
|
34 | $ hg amend s | |||
|
35 | abort: can't commit subrepos without .hgsub | |||
|
36 | [255] | |||
|
37 | ||||
|
38 | amend with subrepo | |||
|
39 | ||||
|
40 | $ hg amend | |||
|
41 | saved backup bundle to * (glob) (obsstore-off !) | |||
|
42 | $ hg status --change . | |||
|
43 | A .hgsub | |||
|
44 | A .hgsubstate | |||
|
45 | A a | |||
|
46 | $ cat .hgsubstate | |||
|
47 | 0000000000000000000000000000000000000000 s | |||
|
48 | ||||
|
49 | Update subrepo | |||
|
50 | -------------- | |||
|
51 | ||||
|
52 | add new commit to be amended | |||
|
53 | ||||
|
54 | $ echo a >> a | |||
|
55 | $ hg ci -m1 | |||
|
56 | ||||
|
57 | amend with dirty subrepo | |||
|
58 | ||||
|
59 | $ echo a >> s/a | |||
|
60 | $ hg add -R s | |||
|
61 | adding s/a | |||
|
62 | $ hg amend | |||
|
63 | abort: uncommitted changes in subrepository "s" | |||
|
64 | (use --subrepos for recursive commit) | |||
|
65 | [255] | |||
|
66 | ||||
|
67 | amend with modified subrepo | |||
|
68 | ||||
|
69 | $ hg ci -R s -m0 | |||
|
70 | $ hg amend | |||
|
71 | saved backup bundle to * (glob) (obsstore-off !) | |||
|
72 | $ hg status --change . | |||
|
73 | M .hgsubstate | |||
|
74 | M a | |||
|
75 | $ cat .hgsubstate | |||
|
76 | f7b1eb17ad24730a1651fccd46c43826d1bbc2ac s | |||
|
77 | ||||
|
78 | revert subrepo change | |||
|
79 | ||||
|
80 | $ hg up -R s -q null | |||
|
81 | $ hg amend | |||
|
82 | saved backup bundle to * (glob) (obsstore-off !) | |||
|
83 | $ hg status --change . | |||
|
84 | M a | |||
|
85 | ||||
|
86 | Link another subrepo | |||
|
87 | -------------------- | |||
|
88 | ||||
|
89 | add new commit to be amended | |||
|
90 | ||||
|
91 | $ echo b >> b | |||
|
92 | $ hg ci -qAm2 | |||
|
93 | ||||
|
94 | also checks if non-subrepo change is included | |||
|
95 | ||||
|
96 | $ echo a >> a | |||
|
97 | ||||
|
98 | amend with another subrepo | |||
|
99 | ||||
|
100 | $ hg init t | |||
|
101 | $ echo b >> t/b | |||
|
102 | $ hg ci -R t -Am0 | |||
|
103 | adding b | |||
|
104 | $ echo 't = t' >> .hgsub | |||
|
105 | $ hg amend | |||
|
106 | saved backup bundle to * (glob) (obsstore-off !) | |||
|
107 | $ hg status --change . | |||
|
108 | M .hgsub | |||
|
109 | M .hgsubstate | |||
|
110 | M a | |||
|
111 | A b | |||
|
112 | $ cat .hgsubstate | |||
|
113 | 0000000000000000000000000000000000000000 s | |||
|
114 | bfb1a4fb358498a9533dabf4f2043d94162f1fcd t | |||
|
115 | ||||
|
116 | Unlink one subrepo | |||
|
117 | ------------------ | |||
|
118 | ||||
|
119 | add new commit to be amended | |||
|
120 | ||||
|
121 | $ echo a >> a | |||
|
122 | $ hg ci -m3 | |||
|
123 | ||||
|
124 | amend with one subrepo dropped | |||
|
125 | ||||
|
126 | $ echo 't = t' > .hgsub | |||
|
127 | $ hg amend | |||
|
128 | saved backup bundle to * (glob) (obsstore-off !) | |||
|
129 | $ hg status --change . | |||
|
130 | M .hgsub | |||
|
131 | M .hgsubstate | |||
|
132 | M a | |||
|
133 | $ cat .hgsubstate | |||
|
134 | bfb1a4fb358498a9533dabf4f2043d94162f1fcd t | |||
|
135 | ||||
|
136 | Unlink subrepos completely | |||
|
137 | -------------------------- | |||
|
138 | ||||
|
139 | add new commit to be amended | |||
|
140 | ||||
|
141 | $ echo a >> a | |||
|
142 | $ hg ci -m3 | |||
|
143 | ||||
|
144 | amend with .hgsub removed | |||
|
145 | ||||
|
146 | $ hg rm .hgsub | |||
|
147 | $ hg amend | |||
|
148 | saved backup bundle to * (glob) (obsstore-off !) | |||
|
149 | $ hg status --change . | |||
|
150 | M a | |||
|
151 | R .hgsub | |||
|
152 | R .hgsubstate | |||
|
153 | ||||
|
154 | $ cd .. |
@@ -28,103 +28,6 b' command = registrar.command(cmdtable)' | |||||
28 | # leave the attribute unspecified. |
|
28 | # leave the attribute unspecified. | |
29 | testedwith = 'ships-with-hg-core' |
|
29 | testedwith = 'ships-with-hg-core' | |
30 |
|
30 | |||
31 | configtable = {} |
|
|||
32 | configitem = registrar.configitem(configtable) |
|
|||
33 |
|
||||
34 | configitem('convert', 'cvsps.cache', |
|
|||
35 | default=True, |
|
|||
36 | ) |
|
|||
37 | configitem('convert', 'cvsps.fuzz', |
|
|||
38 | default=60, |
|
|||
39 | ) |
|
|||
40 | configitem('convert', 'cvsps.logencoding', |
|
|||
41 | default=None, |
|
|||
42 | ) |
|
|||
43 | configitem('convert', 'cvsps.mergefrom', |
|
|||
44 | default=None, |
|
|||
45 | ) |
|
|||
46 | configitem('convert', 'cvsps.mergeto', |
|
|||
47 | default=None, |
|
|||
48 | ) |
|
|||
49 | configitem('convert', 'git.committeractions', |
|
|||
50 | default=lambda: ['messagedifferent'], |
|
|||
51 | ) |
|
|||
52 | configitem('convert', 'git.extrakeys', |
|
|||
53 | default=list, |
|
|||
54 | ) |
|
|||
55 | configitem('convert', 'git.findcopiesharder', |
|
|||
56 | default=False, |
|
|||
57 | ) |
|
|||
58 | configitem('convert', 'git.remoteprefix', |
|
|||
59 | default='remote', |
|
|||
60 | ) |
|
|||
61 | configitem('convert', 'git.renamelimit', |
|
|||
62 | default=400, |
|
|||
63 | ) |
|
|||
64 | configitem('convert', 'git.saverev', |
|
|||
65 | default=True, |
|
|||
66 | ) |
|
|||
67 | configitem('convert', 'git.similarity', |
|
|||
68 | default=50, |
|
|||
69 | ) |
|
|||
70 | configitem('convert', 'git.skipsubmodules', |
|
|||
71 | default=False, |
|
|||
72 | ) |
|
|||
73 | configitem('convert', 'hg.clonebranches', |
|
|||
74 | default=False, |
|
|||
75 | ) |
|
|||
76 | configitem('convert', 'hg.ignoreerrors', |
|
|||
77 | default=False, |
|
|||
78 | ) |
|
|||
79 | configitem('convert', 'hg.revs', |
|
|||
80 | default=None, |
|
|||
81 | ) |
|
|||
82 | configitem('convert', 'hg.saverev', |
|
|||
83 | default=False, |
|
|||
84 | ) |
|
|||
85 | configitem('convert', 'hg.sourcename', |
|
|||
86 | default=None, |
|
|||
87 | ) |
|
|||
88 | configitem('convert', 'hg.startrev', |
|
|||
89 | default=None, |
|
|||
90 | ) |
|
|||
91 | configitem('convert', 'hg.tagsbranch', |
|
|||
92 | default='default', |
|
|||
93 | ) |
|
|||
94 | configitem('convert', 'hg.usebranchnames', |
|
|||
95 | default=True, |
|
|||
96 | ) |
|
|||
97 | configitem('convert', 'ignoreancestorcheck', |
|
|||
98 | default=False, |
|
|||
99 | ) |
|
|||
100 | configitem('convert', 'localtimezone', |
|
|||
101 | default=False, |
|
|||
102 | ) |
|
|||
103 | configitem('convert', 'p4.encoding', |
|
|||
104 | default=lambda: convcmd.orig_encoding, |
|
|||
105 | ) |
|
|||
106 | configitem('convert', 'p4.startrev', |
|
|||
107 | default=0, |
|
|||
108 | ) |
|
|||
109 | configitem('convert', 'skiptags', |
|
|||
110 | default=False, |
|
|||
111 | ) |
|
|||
112 | configitem('convert', 'svn.debugsvnlog', |
|
|||
113 | default=True, |
|
|||
114 | ) |
|
|||
115 | configitem('convert', 'svn.trunk', |
|
|||
116 | default=None, |
|
|||
117 | ) |
|
|||
118 | configitem('convert', 'svn.tags', |
|
|||
119 | default=None, |
|
|||
120 | ) |
|
|||
121 | configitem('convert', 'svn.branches', |
|
|||
122 | default=None, |
|
|||
123 | ) |
|
|||
124 | configitem('convert', 'svn.startrev', |
|
|||
125 | default=0, |
|
|||
126 | ) |
|
|||
127 |
|
||||
128 | # Commands definition was moved elsewhere to ease demandload job. |
|
31 | # Commands definition was moved elsewhere to ease demandload job. | |
129 |
|
32 | |||
130 | @command('convert', |
|
33 | @command('convert', |
@@ -44,6 +44,9 b' def decodefilename(filename):' | |||||
44 |
|
44 | |||
45 | class p4_source(common.converter_source): |
|
45 | class p4_source(common.converter_source): | |
46 | def __init__(self, ui, path, revs=None): |
|
46 | def __init__(self, ui, path, revs=None): | |
|
47 | # avoid import cycle | |||
|
48 | from . import convcmd | |||
|
49 | ||||
47 | super(p4_source, self).__init__(ui, path, revs=revs) |
|
50 | super(p4_source, self).__init__(ui, path, revs=revs) | |
48 |
|
51 | |||
49 | if "/" in path and not path.startswith('//'): |
|
52 | if "/" in path and not path.startswith('//'): | |
@@ -53,7 +56,8 b' class p4_source(common.converter_source)' | |||||
53 | common.checktool('p4', abort=False) |
|
56 | common.checktool('p4', abort=False) | |
54 |
|
57 | |||
55 | self.revmap = {} |
|
58 | self.revmap = {} | |
56 |
self.encoding = self.ui.config('convert', 'p4.encoding' |
|
59 | self.encoding = self.ui.config('convert', 'p4.encoding', | |
|
60 | convcmd.orig_encoding) | |||
57 | self.re_type = re.compile( |
|
61 | self.re_type = re.compile( | |
58 | "([a-z]+)?(text|binary|symlink|apple|resource|unicode|utf\d+)" |
|
62 | "([a-z]+)?(text|binary|symlink|apple|resource|unicode|utf\d+)" | |
59 | "(\+\w+)?$") |
|
63 | "(\+\w+)?$") |
@@ -1512,10 +1512,10 b' msgid " Please use :hg:`log` instead:' | |||||
1512 | msgstr " Por favor use :hg:`log`::" |
|
1512 | msgstr " Por favor use :hg:`log`::" | |
1513 |
|
1513 | |||
1514 | msgid "" |
|
1514 | msgid "" | |
1515 | " hg children => hg log -r \"children()\"\n" |
|
1515 | " hg children => hg log -r \"children(.)\"\n" | |
1516 | " hg children -r REV => hg log -r \"children(REV)\"" |
|
1516 | " hg children -r REV => hg log -r \"children(REV)\"" | |
1517 | msgstr "" |
|
1517 | msgstr "" | |
1518 | " hg children => hg log -r \"children()\"\n" |
|
1518 | " hg children => hg log -r \"children(.)\"\n" | |
1519 | " hg children -r REV => hg log -r \"children(REV)\"" |
|
1519 | " hg children -r REV => hg log -r \"children(REV)\"" | |
1520 |
|
1520 | |||
1521 | msgid " See :hg:`help log` and :hg:`help revsets.children`." |
|
1521 | msgid " See :hg:`help log` and :hg:`help revsets.children`." | |
@@ -5510,7 +5510,7 b' msgstr "edi\xc3\xa7\xc3\xa3o de hist\xc3\xb3rico em andamento, n\xc3\xa3o \xc3\xa9 poss\xc3\xadvel remover %s"' | |||||
5510 | #. i18n: column positioning for "hg summary" |
|
5510 | #. i18n: column positioning for "hg summary" | |
5511 | #, python-format |
|
5511 | #, python-format | |
5512 | msgid "hist: %s (histedit --continue)\n" |
|
5512 | msgid "hist: %s (histedit --continue)\n" | |
5513 |
msgstr "hist: |
|
5513 | msgstr "histedit: %s (histedit --continue)\n" | |
5514 |
|
5514 | |||
5515 | #, python-format |
|
5515 | #, python-format | |
5516 | msgid "%d remaining" |
|
5516 | msgid "%d remaining" | |
@@ -10492,7 +10492,7 b' msgstr ""' | |||||
10492 | " caminho ou URL pedida em :hg:`clone` for idêntico a um repositório\n" |
|
10492 | " caminho ou URL pedida em :hg:`clone` for idêntico a um repositório\n" | |
10493 | " que tenha sido clonado anteriormente." |
|
10493 | " que tenha sido clonado anteriormente." | |
10494 |
|
10494 | |||
10495 |
msgid " The default naming mode is \"identity |
|
10495 | msgid " The default naming mode is \"identity\".\n" | |
10496 | msgstr " O modo de nomeação padrão é \"identity\".\n" |
|
10496 | msgstr " O modo de nomeação padrão é \"identity\".\n" | |
10497 |
|
10497 | |||
10498 | msgid "do not create a working directory" |
|
10498 | msgid "do not create a working directory" | |
@@ -15012,7 +15012,7 b' msgstr " (grafted from CHANGESETHAS' | |||||
15012 |
|
15012 | |||
15013 | msgid "" |
|
15013 | msgid "" | |
15014 | " If --force is specified, revisions will be grafted even if they\n" |
|
15014 | " If --force is specified, revisions will be grafted even if they\n" | |
15015 | " are already ancestors of or have been grafted to the destination.\n" |
|
15015 | " are already ancestors of, or have been grafted to, the destination.\n" | |
15016 | " This is useful when the revisions have since been backed out." |
|
15016 | " This is useful when the revisions have since been backed out." | |
15017 | msgstr "" |
|
15017 | msgstr "" | |
15018 | " Se --force for especificado, as revisões serão enxertadas mesmo\n" |
|
15018 | " Se --force for especificado, as revisões serão enxertadas mesmo\n" | |
@@ -15705,11 +15705,12 b' msgstr "mostra novas revis\xc3\xb5es encontradas na origem"' | |||||
15705 | msgid "" |
|
15705 | msgid "" | |
15706 | " Show new changesets found in the specified path/URL or the default\n" |
|
15706 | " Show new changesets found in the specified path/URL or the default\n" | |
15707 | " pull location. These are the changesets that would have been pulled\n" |
|
15707 | " pull location. These are the changesets that would have been pulled\n" | |
15708 |
" |
|
15708 | " by :hg:`pull` at the time you issued this command." | |
15709 | msgstr "" |
|
15709 | msgstr "" | |
15710 | " Mostra novas revisões encontradas no caminho/URL especificado\n" |
|
15710 | " Mostra novas revisões encontradas no caminho/URL especificado\n" | |
15711 | " ou na localização de pull padrão. Estas são as revisões que\n" |
|
15711 | " ou na localização de pull padrão. Estas são as revisões que\n" | |
15712 |
" seriam trazidas |
|
15712 | " seriam trazidas por :hg:`pull` no momento da execução deste\n" | |
|
15713 | " comando." | |||
15713 |
|
15714 | |||
15714 | msgid " See pull for valid source format details." |
|
15715 | msgid " See pull for valid source format details." | |
15715 | msgstr " Veja pull para detalhes sobre formatos válidos da origem." |
|
15716 | msgstr " Veja pull para detalhes sobre formatos válidos da origem." | |
@@ -16442,8 +16443,8 b' msgstr ""' | |||||
16442 | " secreta, respectivamente." |
|
16443 | " secreta, respectivamente." | |
16443 |
|
16444 | |||
16444 | msgid "" |
|
16445 | msgid "" | |
16445 | " Unless -f/--force is specified, :hg:`phase` won't move changeset from a\n" |
|
16446 | " Unless -f/--force is specified, :hg:`phase` won't move changesets from a\n" | |
16446 |
" lower phase to a |
|
16447 | " lower phase to a higher phase. Phases are ordered as follows::" | |
16447 | msgstr "" |
|
16448 | msgstr "" | |
16448 | " A não ser que -f/--force seja especificado, :hg:`phase` não\n" |
|
16449 | " A não ser que -f/--force seja especificado, :hg:`phase` não\n" | |
16449 | " moverá revisões de uma fase mais baixa para uma mais alta. As\n" |
|
16450 | " moverá revisões de uma fase mais baixa para uma mais alta. As\n" | |
@@ -17449,13 +17450,14 b' msgstr ""' | |||||
17449 | " 'i' 'ignorado' e 'c' 'limpo'." |
|
17450 | " 'i' 'ignorado' e 'c' 'limpo'." | |
17450 |
|
17451 | |||
17451 | msgid "" |
|
17452 | msgid "" | |
17452 |
" It abbreviates only those statuses which are passed. Note that |
|
17453 | " It abbreviates only those statuses which are passed. Note that clean and\n" | |
17453 |
" files are not displayed with '--terse i' unless the - |
|
17454 | " ignored files are not displayed with '--terse ic' unless the -c/--clean\n" | |
17454 | " also used." |
|
17455 | " and -i/--ignored options are also used." | |
17455 | msgstr "" |
|
17456 | msgstr "" | |
17456 | " A saída será abreviada apenas para os status que forem passados.\n" |
|
17457 | " A saída será abreviada apenas para os status que forem passados.\n" | |
17457 |
" Note que arquivos ignorados não serão mostrados com |
|
17458 | " Note que arquivos limpos ou ignorados não serão mostrados com\n" | |
17458 |
" a não ser que a |
|
17459 | " '--terse ic' a não ser que as opções -c/--clean e -i/--ignored\n" | |
|
17460 | " também sejam usadas." | |||
17459 |
|
17461 | |||
17460 | msgid "" |
|
17462 | msgid "" | |
17461 | " The -v/--verbose option shows information when the repository is in an\n" |
|
17463 | " The -v/--verbose option shows information when the repository is in an\n" | |
@@ -20935,6 +20937,9 b' msgstr "Censura"' | |||||
20935 | msgid "Changegroups" |
|
20937 | msgid "Changegroups" | |
20936 | msgstr "Changegroups" |
|
20938 | msgstr "Changegroups" | |
20937 |
|
20939 | |||
|
20940 | msgid "Config Registrar" | |||
|
20941 | msgstr "Registrador de Configurações" | |||
|
20942 | ||||
20938 | msgid "Repository Requirements" |
|
20943 | msgid "Repository Requirements" | |
20939 | msgstr "Requisitos do Repositório" |
|
20944 | msgstr "Requisitos do Repositório" | |
20940 |
|
20945 | |||
@@ -23843,25 +23848,31 b' msgid ""' | |||||
23843 | " Run right before a phase change is actually finalized. Any repository change\n" |
|
23848 | " Run right before a phase change is actually finalized. Any repository change\n" | |
23844 | " will be visible to the hook program. This lets you validate the transaction\n" |
|
23849 | " will be visible to the hook program. This lets you validate the transaction\n" | |
23845 | " content or change it. Exit status 0 allows the commit to proceed. A non-zero\n" |
|
23850 | " content or change it. Exit status 0 allows the commit to proceed. A non-zero\n" | |
23846 | " status will cause the transaction to be rolled back.\n" |
|
23851 | " status will cause the transaction to be rolled back. The hook is called\n" | |
|
23852 | " multiple times, once for each revision affected by a phase change.\n" | |||
23847 | " The affected node is available in ``$HG_NODE``, the phase in ``$HG_PHASE``\n" |
|
23853 | " The affected node is available in ``$HG_NODE``, the phase in ``$HG_PHASE``\n" | |
23848 | " while the previous ``$HG_OLDPHASE``. In case of new node, ``$HG_OLDPHASE``\n" |
|
23854 | " while the previous ``$HG_OLDPHASE``. In case of new node, ``$HG_OLDPHASE``\n" | |
23849 | " will be empty. In addition, the reason for the transaction opening will be in\n" |
|
23855 | " will be empty. In addition, the reason for the transaction opening will be in\n" | |
23850 | " ``$HG_TXNNAME``, and a unique identifier for the transaction will be in\n" |
|
23856 | " ``$HG_TXNNAME``, and a unique identifier for the transaction will be in\n" | |
23851 | " ``HG_TXNID``." |
|
23857 | " ``HG_TXNID``. The hook is also run for newly added revisions. In this case\n" | |
23852 | msgstr "" |
|
23858 | " the ``$HG_OLDPHASE`` entry will be empty." | |
23853 | "``pretxnclose``\n" |
|
23859 | msgstr "" | |
|
23860 | "``pretxnclose-phase``\n" | |||
23854 | " Executado imediatamente antes de uma mudança de fase ser finalizada.\n" |
|
23861 | " Executado imediatamente antes de uma mudança de fase ser finalizada.\n" | |
23855 | " Qualquer mudança do repositório será visível para o gancho.\n" |
|
23862 | " Qualquer mudança do repositório será visível para o gancho.\n" | |
23856 | " Isto permite que o conteúdo da transação seja validado ou alterado.\n" |
|
23863 | " Isto permite que o conteúdo da transação seja validado ou alterado.\n" | |
23857 | " O status de saída 0 permite que a consolidação prossiga. Um status\n" |
|
23864 | " O status de saída 0 permite que a consolidação prossiga. Um status\n" | |
23858 | " de saída diferente de zero fará com que a transação seja desfeita.\n" |
|
23865 | " de saída diferente de zero fará com que a transação seja desfeita.\n" | |
|
23866 | " O gancho é chamado diversas vezes, uma para cada revisão afetada\n" | |||
|
23867 | " pela mudança de fase.\n" | |||
23859 | " O nó afetado será passado em ``$HG_NODE``, a nova fase em ``$HG_PHASE``\n" |
|
23868 | " O nó afetado será passado em ``$HG_NODE``, a nova fase em ``$HG_PHASE``\n" | |
23860 | " e a anterior em ``$HG_OLDPHASE``.\n" |
|
23869 | " e a anterior em ``$HG_OLDPHASE``.\n" | |
23861 | " No caso de um novo nó, ``$HG_OLDPHASE`` estará vazia.\n" |
|
23870 | " No caso de um novo nó, ``$HG_OLDPHASE`` estará vazia.\n" | |
23862 | " Adicionalmente, a razão da abertura da transação será passada em\n" |
|
23871 | " Adicionalmente, a razão da abertura da transação será passada em\n" | |
23863 | " ``$HG_TXNNAME``, e um identificador único para a transação será\n" |
|
23872 | " ``$HG_TXNNAME``, e um identificador único para a transação será\n" | |
23864 | " passado em ``HG_TXNID``." |
|
23873 | " passado em ``HG_TXNID``.\n" | |
|
23874 | " O gancho também será executado para revisões novas; nesse caso,\n" | |||
|
23875 | " ``$HG_OLDPHASE`` estará vazia." | |||
23865 |
|
23876 | |||
23866 | msgid "" |
|
23877 | msgid "" | |
23867 | "``txnclose``\n" |
|
23878 | "``txnclose``\n" | |
@@ -25832,6 +25843,105 b' msgstr ""' | |||||
25832 | "As regras são aplicadas na ordem de definição." |
|
25843 | "As regras são aplicadas na ordem de definição." | |
25833 |
|
25844 | |||
25834 | msgid "" |
|
25845 | msgid "" | |
|
25846 | "``subrepos``\n" | |||
|
25847 | "------------" | |||
|
25848 | msgstr "" | |||
|
25849 | "``subrepos``\n" | |||
|
25850 | "------------" | |||
|
25851 | ||||
|
25852 | msgid "" | |||
|
25853 | "This section contains options that control the behavior of the\n" | |||
|
25854 | "subrepositories feature. See also :hg:`help subrepos`." | |||
|
25855 | msgstr "" | |||
|
25856 | "Esta seção contém opções que controlam o comportamento\n" | |||
|
25857 | "da funcionalidade de sub-repositórios.\n" | |||
|
25858 | "Veja também :hg:`help subrepos`." | |||
|
25859 | ||||
|
25860 | msgid "" | |||
|
25861 | "Security note: auditing in Mercurial is known to be insufficient to\n" | |||
|
25862 | "prevent clone-time code execution with carefully constructed Git\n" | |||
|
25863 | "subrepos. It is unknown if a similar detect is present in Subversion\n" | |||
|
25864 | "subrepos. Both Git and Subversion subrepos are disabled by default\n" | |||
|
25865 | "out of security concerns. These subrepo types can be enabled using\n" | |||
|
25866 | "the respective options below." | |||
|
25867 | msgstr "" | |||
|
25868 | "Aviso de segurança: sabe-se que a auditoria no Mercurial é\n" | |||
|
25869 | "insuficiente para impedir execução de código no momento da\n" | |||
|
25870 | "clonagem com repositórios Git construídos maliciosamente.\n" | |||
|
25871 | "Não se sabe se esse problema afeta repositórios do Subversion.\n" | |||
|
25872 | "Tanto sub-repositórios do Git como do Subversion são por padrão\n" | |||
|
25873 | "desabilitados por razões de segurança.\n" | |||
|
25874 | "Esses tipos de sub-repositórios podem ser habilitados usando as\n" | |||
|
25875 | "respectivas opções abaixo." | |||
|
25876 | ||||
|
25877 | msgid "" | |||
|
25878 | "``allowed``\n" | |||
|
25879 | " Whether subrepositories are allowed in the working directory." | |||
|
25880 | msgstr "" | |||
|
25881 | "``allowed``\n" | |||
|
25882 | " Define se sub-repositórios são permitidos no diretório\n" | |||
|
25883 | " de trabalho." | |||
|
25884 | ||||
|
25885 | msgid "" | |||
|
25886 | " When false, commands involving subrepositories (like :hg:`update`)\n" | |||
|
25887 | " will fail for all subrepository types.\n" | |||
|
25888 | " (default: true)" | |||
|
25889 | msgstr "" | |||
|
25890 | " Se False, comandos envolvendo sub-repositórios (como :hg:`update`)\n" | |||
|
25891 | " falharão para todos os tipos de sub-repositório.\n" | |||
|
25892 | " (padrão: True)" | |||
|
25893 | ||||
|
25894 | msgid "" | |||
|
25895 | "``hg:allowed``\n" | |||
|
25896 | " Whether Mercurial subrepositories are allowed in the working\n" | |||
|
25897 | " directory. This option only has an effect if ``subrepos.allowed``\n" | |||
|
25898 | " is true.\n" | |||
|
25899 | " (default: true)" | |||
|
25900 | msgstr "" | |||
|
25901 | "``hg:allowed``\n" | |||
|
25902 | " Se sub-repositórios do Mercurial são permitidos no diretório\n" | |||
|
25903 | " de trabalho.\n" | |||
|
25904 | " Esta opção tem efeito apenas se ``subrepos.allowed`` for True.\n" | |||
|
25905 | " (padrão: True)" | |||
|
25906 | ||||
|
25907 | msgid "" | |||
|
25908 | "``git:allowed``\n" | |||
|
25909 | " Whether Git subrepositories are allowed in the working directory.\n" | |||
|
25910 | " This option only has an effect if ``subrepos.allowed`` is true." | |||
|
25911 | msgstr "" | |||
|
25912 | "``git:allowed``\n" | |||
|
25913 | " Se sub-repositórios do Git são permitidos no diretório\n" | |||
|
25914 | " de trabalho.\n" | |||
|
25915 | " Esta opção tem efeito apenas se ``subrepos.allowed`` for True." | |||
|
25916 | ||||
|
25917 | msgid "" | |||
|
25918 | " See the security note above before enabling Git subrepos.\n" | |||
|
25919 | " (default: false)" | |||
|
25920 | msgstr "" | |||
|
25921 | " Veja o aviso de segurança acima antes de habilitar\n" | |||
|
25922 | " sub-repositórios do Git.\n" | |||
|
25923 | " (padrão: False)" | |||
|
25924 | ||||
|
25925 | msgid "" | |||
|
25926 | "``svn:allowed``\n" | |||
|
25927 | " Whether Subversion subrepositories are allowed in the working\n" | |||
|
25928 | " directory. This option only has an effect if ``subrepos.allowed``\n" | |||
|
25929 | " is true." | |||
|
25930 | msgstr "" | |||
|
25931 | "``svn:allowed``\n" | |||
|
25932 | " Se sub-repositórios do Subversion são permitidos no diretório\n" | |||
|
25933 | " de trabalho.\n" | |||
|
25934 | " Esta opção tem efeito apenas se ``subrepos.allowed`` for True." | |||
|
25935 | ||||
|
25936 | msgid "" | |||
|
25937 | " See the security note above before enabling Subversion subrepos.\n" | |||
|
25938 | " (default: false)" | |||
|
25939 | msgstr "" | |||
|
25940 | " Veja o aviso de segurança acima antes de habilitar\n" | |||
|
25941 | " sub-repositórios do Subversion.\n" | |||
|
25942 | " (padrão: False)" | |||
|
25943 | ||||
|
25944 | msgid "" | |||
25835 | "``templatealias``\n" |
|
25945 | "``templatealias``\n" | |
25836 | "-----------------" |
|
25946 | "-----------------" | |
25837 | msgstr "" |
|
25947 | msgstr "" | |
@@ -29958,7 +30068,7 b' msgstr "8. Caso contr\xc3\xa1rio, ``:prompt`` ser\xc3\xa1 usado."' | |||||
29958 | msgid "" |
|
30068 | msgid "" | |
29959 | " After selecting a merge program, Mercurial will by default attempt\n" |
|
30069 | " After selecting a merge program, Mercurial will by default attempt\n" | |
29960 | " to merge the files using a simple merge algorithm first. Only if it doesn't\n" |
|
30070 | " to merge the files using a simple merge algorithm first. Only if it doesn't\n" | |
29961 |
" succeed because of conflicting changes Mercuria |
|
30071 | " succeed because of conflicting changes will Mercurial actually execute the\n" | |
29962 | " merge program. Whether to use the simple merge algorithm first can be\n" |
|
30072 | " merge program. Whether to use the simple merge algorithm first can be\n" | |
29963 | " controlled by the premerge setting of the merge tool. Premerge is enabled by\n" |
|
30073 | " controlled by the premerge setting of the merge tool. Premerge is enabled by\n" | |
29964 | " default unless the file is binary or a symlink." |
|
30074 | " default unless the file is binary or a symlink." | |
@@ -30334,7 +30444,7 b' msgstr ""' | |||||
30334 | "Veja :hg:`help -v phase` para alguns exemplos." |
|
30444 | "Veja :hg:`help -v phase` para alguns exemplos." | |
30335 |
|
30445 | |||
30336 | msgid "" |
|
30446 | msgid "" | |
30337 |
"To make your |
|
30447 | "To make your commits secret by default, put this in your\n" | |
30338 | "configuration file::" |
|
30448 | "configuration file::" | |
30339 | msgstr "" |
|
30449 | msgstr "" | |
30340 | "Para colocar suas consolidações na fase secret por padrão,\n" |
|
30450 | "Para colocar suas consolidações na fase secret por padrão,\n" | |
@@ -30453,7 +30563,7 b' msgstr ""' | |||||
30453 | msgid " hg phase --force --draft ." |
|
30563 | msgid " hg phase --force --draft ." | |
30454 | msgstr " hg phase --force --draft ." |
|
30564 | msgstr " hg phase --force --draft ." | |
30455 |
|
30565 | |||
30456 | msgid " - show a list of changeset revision and phase::" |
|
30566 | msgid " - show a list of changeset revisions and each corresponding phase::" | |
30457 | msgstr " - mostra uma lista de números de revisão e suas respectivas fases::" |
|
30567 | msgstr " - mostra uma lista de números de revisão e suas respectivas fases::" | |
30458 |
|
30568 | |||
30459 | msgid " hg log --template \"{rev} {phase}\\n\"" |
|
30569 | msgid " hg log --template \"{rev} {phase}\\n\"" | |
@@ -30755,7 +30865,7 b' msgstr ""' | |||||
30755 |
|
30865 | |||
30756 | msgid "" |
|
30866 | msgid "" | |
30757 | "For example, ``tag(r're:(?i)release')`` matches \"release\" or \"RELEASE\"\n" |
|
30867 | "For example, ``tag(r're:(?i)release')`` matches \"release\" or \"RELEASE\"\n" | |
30758 | "or \"Release\", etc" |
|
30868 | "or \"Release\", etc." | |
30759 | msgstr "" |
|
30869 | msgstr "" | |
30760 | "Por exemplo, ``tag(r're:(?i)release')`` corresponde a \"release\"\n" |
|
30870 | "Por exemplo, ``tag(r're:(?i)release')`` corresponde a \"release\"\n" | |
30761 | "ou \"RELEASE\" ou \"Release\", etc." |
|
30871 | "ou \"RELEASE\" ou \"Release\", etc." | |
@@ -30886,7 +30996,7 b' msgstr ""' | |||||
30886 | " hg log -r \"(keyword(bug) or keyword(issue)) and not ancestors(tag())\"" |
|
30996 | " hg log -r \"(keyword(bug) or keyword(issue)) and not ancestors(tag())\"" | |
30887 |
|
30997 | |||
30888 | msgid "" |
|
30998 | msgid "" | |
30889 |
"- Update to commit that bookmark @ is pointing t |
|
30999 | "- Update to the commit that bookmark @ is pointing to, without activating the\n" | |
30890 | " bookmark (this works because the last revision of the revset is used)::" |
|
31000 | " bookmark (this works because the last revision of the revset is used)::" | |
30891 | msgstr "" |
|
31001 | msgstr "" | |
30892 | "- Atualiza para a revisão que o marcador @ está apontando, sem ativar\n" |
|
31002 | "- Atualiza para a revisão que o marcador @ está apontando, sem ativar\n" | |
@@ -36031,6 +36141,20 b' msgid "warning: removing potentially hos' | |||||
36031 | msgstr "aviso: removendo 'hgrc' potencialmente hostil em '%s'\n" |
|
36141 | msgstr "aviso: removendo 'hgrc' potencialmente hostil em '%s'\n" | |
36032 |
|
36142 | |||
36033 | #, python-format |
|
36143 | #, python-format | |
|
36144 | msgid "subrepo '%s' traverses symbolic link" | |||
|
36145 | msgstr "o sub-repositório '%s' atravessa um link simbólico" | |||
|
36146 | ||||
|
36147 | msgid "subrepos not enabled" | |||
|
36148 | msgstr "sub-repositórios não estão habilitados" | |||
|
36149 | ||||
|
36150 | msgid "see 'hg help config.subrepos' for details" | |||
|
36151 | msgstr "veja 'hg help config.subrepos' para detalhes" | |||
|
36152 | ||||
|
36153 | #, python-format | |||
|
36154 | msgid "%s subrepos not allowed" | |||
|
36155 | msgstr "sub-repositórios %s não são permitidos" | |||
|
36156 | ||||
|
36157 | #, python-format | |||
36034 | msgid "unknown subrepo type %s" |
|
36158 | msgid "unknown subrepo type %s" | |
36035 | msgstr "tipo de sub-repositório %s desconhecido" |
|
36159 | msgstr "tipo de sub-repositório %s desconhecido" | |
36036 |
|
36160 |
@@ -235,6 +235,7 b' def _loadnewui(srcui, args):' | |||||
235 | cwds = dispatch._earlygetopt(['--cwd'], args) |
|
235 | cwds = dispatch._earlygetopt(['--cwd'], args) | |
236 | cwd = cwds and os.path.realpath(cwds[-1]) or None |
|
236 | cwd = cwds and os.path.realpath(cwds[-1]) or None | |
237 | rpath = dispatch._earlygetopt(["-R", "--repository", "--repo"], args) |
|
237 | rpath = dispatch._earlygetopt(["-R", "--repository", "--repo"], args) | |
|
238 | rpath = rpath and rpath[-1] or '' | |||
238 | path, newlui = dispatch._getlocal(newui, rpath, wd=cwd) |
|
239 | path, newlui = dispatch._getlocal(newui, rpath, wd=cwd) | |
239 |
|
240 | |||
240 | return (newui, newlui) |
|
241 | return (newui, newlui) |
@@ -3166,6 +3166,18 b' def amend(ui, repo, old, extra, pats, op' | |||||
3166 | raise error.Abort( |
|
3166 | raise error.Abort( | |
3167 | _("failed to mark all new/missing files as added/removed")) |
|
3167 | _("failed to mark all new/missing files as added/removed")) | |
3168 |
|
3168 | |||
|
3169 | # Check subrepos. This depends on in-place wctx._status update in | |||
|
3170 | # subrepo.precommit(). To minimize the risk of this hack, we do | |||
|
3171 | # nothing if .hgsub does not exist. | |||
|
3172 | if '.hgsub' in wctx or '.hgsub' in old: | |||
|
3173 | from . import subrepo # avoid cycle: cmdutil -> subrepo -> cmdutil | |||
|
3174 | subs, commitsubs, newsubstate = subrepo.precommit( | |||
|
3175 | ui, wctx, wctx._status, matcher) | |||
|
3176 | # amend should abort if commitsubrepos is enabled | |||
|
3177 | assert not commitsubs | |||
|
3178 | if subs: | |||
|
3179 | subrepo.writestate(repo, newsubstate) | |||
|
3180 | ||||
3169 | filestoamend = set(f for f in wctx.files() if matcher(f)) |
|
3181 | filestoamend = set(f for f in wctx.files() if matcher(f)) | |
3170 |
|
3182 | |||
3171 | changes = (len(filestoamend) > 0) |
|
3183 | changes = (len(filestoamend) > 0) | |
@@ -3179,9 +3191,11 b' def amend(ui, repo, old, extra, pats, op' | |||||
3179 | # introduced file X and the file was renamed in the working |
|
3191 | # introduced file X and the file was renamed in the working | |
3180 | # copy, then those two files are the same and |
|
3192 | # copy, then those two files are the same and | |
3181 | # we can discard X from our list of files. Likewise if X |
|
3193 | # we can discard X from our list of files. Likewise if X | |
3182 |
# was |
|
3194 | # was removed, it's no longer relevant. If X is missing (aka | |
|
3195 | # deleted), old X must be preserved. | |||
3183 | files.update(filestoamend) |
|
3196 | files.update(filestoamend) | |
3184 |
files = [f for f in files if not samefile(f, wctx, base) |
|
3197 | files = [f for f in files if (not samefile(f, wctx, base) | |
|
3198 | or f in wctx.deleted())] | |||
3185 |
|
3199 | |||
3186 | def filectxfn(repo, ctx_, path): |
|
3200 | def filectxfn(repo, ctx_, path): | |
3187 | try: |
|
3201 | try: | |
@@ -3193,12 +3207,11 b' def amend(ui, repo, old, extra, pats, op' | |||||
3193 | if path not in filestoamend: |
|
3207 | if path not in filestoamend: | |
3194 | return old.filectx(path) |
|
3208 | return old.filectx(path) | |
3195 |
|
3209 | |||
|
3210 | # Return None for removed files. | |||
|
3211 | if path in wctx.removed(): | |||
|
3212 | return None | |||
|
3213 | ||||
3196 | fctx = wctx[path] |
|
3214 | fctx = wctx[path] | |
3197 |
|
||||
3198 | # Return None for removed files. |
|
|||
3199 | if not fctx.exists(): |
|
|||
3200 | return None |
|
|||
3201 |
|
||||
3202 | flags = fctx.flags() |
|
3215 | flags = fctx.flags() | |
3203 | mctx = context.memfilectx(repo, |
|
3216 | mctx = context.memfilectx(repo, | |
3204 | fctx.path(), fctx.data(), |
|
3217 | fctx.path(), fctx.data(), |
@@ -103,6 +103,10 b' globalopts = [' | |||||
103 | _("when to paginate (boolean, always, auto, or never)"), _('TYPE')), |
|
103 | _("when to paginate (boolean, always, auto, or never)"), _('TYPE')), | |
104 | ] |
|
104 | ] | |
105 |
|
105 | |||
|
106 | # options which must be pre-parsed before loading configs and extensions | |||
|
107 | # TODO: perhaps --debugger should be included | |||
|
108 | earlyoptflags = ("--cwd", "-R", "--repository", "--repo", "--config") | |||
|
109 | ||||
106 | dryrunopts = cmdutil.dryrunopts |
|
110 | dryrunopts = cmdutil.dryrunopts | |
107 | remoteopts = cmdutil.remoteopts |
|
111 | remoteopts = cmdutil.remoteopts | |
108 | walkopts = cmdutil.walkopts |
|
112 | walkopts = cmdutil.walkopts |
@@ -208,6 +208,99 b" coreconfigitem('committemplate', '.*'," | |||||
208 | default=None, |
|
208 | default=None, | |
209 | generic=True, |
|
209 | generic=True, | |
210 | ) |
|
210 | ) | |
|
211 | coreconfigitem('convert', 'cvsps.cache', | |||
|
212 | default=True, | |||
|
213 | ) | |||
|
214 | coreconfigitem('convert', 'cvsps.fuzz', | |||
|
215 | default=60, | |||
|
216 | ) | |||
|
217 | coreconfigitem('convert', 'cvsps.logencoding', | |||
|
218 | default=None, | |||
|
219 | ) | |||
|
220 | coreconfigitem('convert', 'cvsps.mergefrom', | |||
|
221 | default=None, | |||
|
222 | ) | |||
|
223 | coreconfigitem('convert', 'cvsps.mergeto', | |||
|
224 | default=None, | |||
|
225 | ) | |||
|
226 | coreconfigitem('convert', 'git.committeractions', | |||
|
227 | default=lambda: ['messagedifferent'], | |||
|
228 | ) | |||
|
229 | coreconfigitem('convert', 'git.extrakeys', | |||
|
230 | default=list, | |||
|
231 | ) | |||
|
232 | coreconfigitem('convert', 'git.findcopiesharder', | |||
|
233 | default=False, | |||
|
234 | ) | |||
|
235 | coreconfigitem('convert', 'git.remoteprefix', | |||
|
236 | default='remote', | |||
|
237 | ) | |||
|
238 | coreconfigitem('convert', 'git.renamelimit', | |||
|
239 | default=400, | |||
|
240 | ) | |||
|
241 | coreconfigitem('convert', 'git.saverev', | |||
|
242 | default=True, | |||
|
243 | ) | |||
|
244 | coreconfigitem('convert', 'git.similarity', | |||
|
245 | default=50, | |||
|
246 | ) | |||
|
247 | coreconfigitem('convert', 'git.skipsubmodules', | |||
|
248 | default=False, | |||
|
249 | ) | |||
|
250 | coreconfigitem('convert', 'hg.clonebranches', | |||
|
251 | default=False, | |||
|
252 | ) | |||
|
253 | coreconfigitem('convert', 'hg.ignoreerrors', | |||
|
254 | default=False, | |||
|
255 | ) | |||
|
256 | coreconfigitem('convert', 'hg.revs', | |||
|
257 | default=None, | |||
|
258 | ) | |||
|
259 | coreconfigitem('convert', 'hg.saverev', | |||
|
260 | default=False, | |||
|
261 | ) | |||
|
262 | coreconfigitem('convert', 'hg.sourcename', | |||
|
263 | default=None, | |||
|
264 | ) | |||
|
265 | coreconfigitem('convert', 'hg.startrev', | |||
|
266 | default=None, | |||
|
267 | ) | |||
|
268 | coreconfigitem('convert', 'hg.tagsbranch', | |||
|
269 | default='default', | |||
|
270 | ) | |||
|
271 | coreconfigitem('convert', 'hg.usebranchnames', | |||
|
272 | default=True, | |||
|
273 | ) | |||
|
274 | coreconfigitem('convert', 'ignoreancestorcheck', | |||
|
275 | default=False, | |||
|
276 | ) | |||
|
277 | coreconfigitem('convert', 'localtimezone', | |||
|
278 | default=False, | |||
|
279 | ) | |||
|
280 | coreconfigitem('convert', 'p4.encoding', | |||
|
281 | default=dynamicdefault, | |||
|
282 | ) | |||
|
283 | coreconfigitem('convert', 'p4.startrev', | |||
|
284 | default=0, | |||
|
285 | ) | |||
|
286 | coreconfigitem('convert', 'skiptags', | |||
|
287 | default=False, | |||
|
288 | ) | |||
|
289 | coreconfigitem('convert', 'svn.debugsvnlog', | |||
|
290 | default=True, | |||
|
291 | ) | |||
|
292 | coreconfigitem('convert', 'svn.trunk', | |||
|
293 | default=None, | |||
|
294 | ) | |||
|
295 | coreconfigitem('convert', 'svn.tags', | |||
|
296 | default=None, | |||
|
297 | ) | |||
|
298 | coreconfigitem('convert', 'svn.branches', | |||
|
299 | default=None, | |||
|
300 | ) | |||
|
301 | coreconfigitem('convert', 'svn.startrev', | |||
|
302 | default=0, | |||
|
303 | ) | |||
211 | coreconfigitem('debug', 'dirstate.delaywrite', |
|
304 | coreconfigitem('debug', 'dirstate.delaywrite', | |
212 | default=0, |
|
305 | default=0, | |
213 | ) |
|
306 | ) |
@@ -55,6 +55,9 b' class request(object):' | |||||
55 | self.fout = fout |
|
55 | self.fout = fout | |
56 | self.ferr = ferr |
|
56 | self.ferr = ferr | |
57 |
|
57 | |||
|
58 | # remember options pre-parsed by _earlyreqopt*() | |||
|
59 | self.earlyoptions = {} | |||
|
60 | ||||
58 | # reposetups which run before extensions, useful for chg to pre-fill |
|
61 | # reposetups which run before extensions, useful for chg to pre-fill | |
59 | # low-level repo state (for example, changelog) before extensions. |
|
62 | # low-level repo state (for example, changelog) before extensions. | |
60 | self.prereposetups = prereposetups or [] |
|
63 | self.prereposetups = prereposetups or [] | |
@@ -147,7 +150,7 b' def dispatch(req):' | |||||
147 | try: |
|
150 | try: | |
148 | if not req.ui: |
|
151 | if not req.ui: | |
149 | req.ui = uimod.ui.load() |
|
152 | req.ui = uimod.ui.load() | |
150 | if '--traceback' in req.args: |
|
153 | if _earlyreqoptbool(req, 'traceback', ['--traceback']): | |
151 | req.ui.setconfig('ui', 'traceback', 'on', '--traceback') |
|
154 | req.ui.setconfig('ui', 'traceback', 'on', '--traceback') | |
152 |
|
155 | |||
153 | # set ui streams from the request |
|
156 | # set ui streams from the request | |
@@ -261,7 +264,8 b' def _runcatch(req):' | |||||
261 |
|
264 | |||
262 | # read --config before doing anything else |
|
265 | # read --config before doing anything else | |
263 | # (e.g. to change trust settings for reading .hg/hgrc) |
|
266 | # (e.g. to change trust settings for reading .hg/hgrc) | |
264 |
cfgs = _parseconfig(req.ui, |
|
267 | cfgs = _parseconfig(req.ui, | |
|
268 | _earlyreqopt(req, 'config', ['--config'])) | |||
265 |
|
269 | |||
266 | if req.repo: |
|
270 | if req.repo: | |
267 | # copy configs that were passed on the cmdline (--config) to |
|
271 | # copy configs that were passed on the cmdline (--config) to | |
@@ -275,7 +279,7 b' def _runcatch(req):' | |||||
275 | if not debugger or ui.plain(): |
|
279 | if not debugger or ui.plain(): | |
276 | # if we are in HGPLAIN mode, then disable custom debugging |
|
280 | # if we are in HGPLAIN mode, then disable custom debugging | |
277 | debugger = 'pdb' |
|
281 | debugger = 'pdb' | |
278 | elif '--debugger' in req.args: |
|
282 | elif _earlyreqoptbool(req, 'debugger', ['--debugger']): | |
279 | # This import can be slow for fancy debuggers, so only |
|
283 | # This import can be slow for fancy debuggers, so only | |
280 | # do it when absolutely necessary, i.e. when actual |
|
284 | # do it when absolutely necessary, i.e. when actual | |
281 | # debugging has been requested |
|
285 | # debugging has been requested | |
@@ -289,7 +293,7 b' def _runcatch(req):' | |||||
289 | debugmortem[debugger] = debugmod.post_mortem |
|
293 | debugmortem[debugger] = debugmod.post_mortem | |
290 |
|
294 | |||
291 | # enter the debugger before command execution |
|
295 | # enter the debugger before command execution | |
292 | if '--debugger' in req.args: |
|
296 | if _earlyreqoptbool(req, 'debugger', ['--debugger']): | |
293 | ui.warn(_("entering debugger - " |
|
297 | ui.warn(_("entering debugger - " | |
294 | "type c to continue starting hg or h for help\n")) |
|
298 | "type c to continue starting hg or h for help\n")) | |
295 |
|
299 | |||
@@ -305,7 +309,7 b' def _runcatch(req):' | |||||
305 | ui.flush() |
|
309 | ui.flush() | |
306 | except: # re-raises |
|
310 | except: # re-raises | |
307 | # enter the debugger when we hit an exception |
|
311 | # enter the debugger when we hit an exception | |
308 | if '--debugger' in req.args: |
|
312 | if _earlyreqoptbool(req, 'debugger', ['--debugger']): | |
309 | traceback.print_exc() |
|
313 | traceback.print_exc() | |
310 | debugmortem[debugger](sys.exc_info()[2]) |
|
314 | debugmortem[debugger](sys.exc_info()[2]) | |
311 | raise |
|
315 | raise | |
@@ -465,7 +469,7 b' class cmdalias(object):' | |||||
465 | self.cmdname = cmd = args.pop(0) |
|
469 | self.cmdname = cmd = args.pop(0) | |
466 | self.givenargs = args |
|
470 | self.givenargs = args | |
467 |
|
471 | |||
468 | for invalidarg in ("--cwd", "-R", "--repository", "--repo", "--config"): |
|
472 | for invalidarg in commands.earlyoptflags: | |
469 | if _earlygetopt([invalidarg], args): |
|
473 | if _earlygetopt([invalidarg], args): | |
470 | self.badalias = (_("error in definition for alias '%s': %s may " |
|
474 | self.badalias = (_("error in definition for alias '%s': %s may " | |
471 | "only be given on the command line") |
|
475 | "only be given on the command line") | |
@@ -640,11 +644,11 b' def _parseconfig(ui, config):' | |||||
640 |
|
644 | |||
641 | return configs |
|
645 | return configs | |
642 |
|
646 | |||
643 | def _earlygetopt(aliases, args): |
|
647 | def _earlygetopt(aliases, args, strip=True): | |
644 | """Return list of values for an option (or aliases). |
|
648 | """Return list of values for an option (or aliases). | |
645 |
|
649 | |||
646 | The values are listed in the order they appear in args. |
|
650 | The values are listed in the order they appear in args. | |
647 | The options and values are removed from args. |
|
651 | The options and values are removed from args if strip=True. | |
648 |
|
652 | |||
649 | >>> args = [b'x', b'--cwd', b'foo', b'y'] |
|
653 | >>> args = [b'x', b'--cwd', b'foo', b'y'] | |
650 | >>> _earlygetopt([b'--cwd'], args), args |
|
654 | >>> _earlygetopt([b'--cwd'], args), args | |
@@ -654,13 +658,33 b' def _earlygetopt(aliases, args):' | |||||
654 | >>> _earlygetopt([b'--cwd'], args), args |
|
658 | >>> _earlygetopt([b'--cwd'], args), args | |
655 | (['bar'], ['x', 'y']) |
|
659 | (['bar'], ['x', 'y']) | |
656 |
|
660 | |||
|
661 | >>> args = [b'x', b'--cwd=bar', b'y'] | |||
|
662 | >>> _earlygetopt([b'--cwd'], args, strip=False), args | |||
|
663 | (['bar'], ['x', '--cwd=bar', 'y']) | |||
|
664 | ||||
657 | >>> args = [b'x', b'-R', b'foo', b'y'] |
|
665 | >>> args = [b'x', b'-R', b'foo', b'y'] | |
658 | >>> _earlygetopt([b'-R'], args), args |
|
666 | >>> _earlygetopt([b'-R'], args), args | |
659 | (['foo'], ['x', 'y']) |
|
667 | (['foo'], ['x', 'y']) | |
660 |
|
668 | |||
|
669 | >>> args = [b'x', b'-R', b'foo', b'y'] | |||
|
670 | >>> _earlygetopt([b'-R'], args, strip=False), args | |||
|
671 | (['foo'], ['x', '-R', 'foo', 'y']) | |||
|
672 | ||||
661 | >>> args = [b'x', b'-Rbar', b'y'] |
|
673 | >>> args = [b'x', b'-Rbar', b'y'] | |
662 | >>> _earlygetopt([b'-R'], args), args |
|
674 | >>> _earlygetopt([b'-R'], args), args | |
663 | (['bar'], ['x', 'y']) |
|
675 | (['bar'], ['x', 'y']) | |
|
676 | ||||
|
677 | >>> args = [b'x', b'-Rbar', b'y'] | |||
|
678 | >>> _earlygetopt([b'-R'], args, strip=False), args | |||
|
679 | (['bar'], ['x', '-Rbar', 'y']) | |||
|
680 | ||||
|
681 | >>> args = [b'x', b'-R=bar', b'y'] | |||
|
682 | >>> _earlygetopt([b'-R'], args), args | |||
|
683 | (['=bar'], ['x', 'y']) | |||
|
684 | ||||
|
685 | >>> args = [b'x', b'-R', b'--', b'y'] | |||
|
686 | >>> _earlygetopt([b'-R'], args), args | |||
|
687 | ([], ['x', '-R', '--', 'y']) | |||
664 | """ |
|
688 | """ | |
665 | try: |
|
689 | try: | |
666 | argcount = args.index("--") |
|
690 | argcount = args.index("--") | |
@@ -671,28 +695,77 b' def _earlygetopt(aliases, args):' | |||||
671 | pos = 0 |
|
695 | pos = 0 | |
672 | while pos < argcount: |
|
696 | while pos < argcount: | |
673 | fullarg = arg = args[pos] |
|
697 | fullarg = arg = args[pos] | |
|
698 | equals = -1 | |||
|
699 | if arg.startswith('--'): | |||
674 | equals = arg.find('=') |
|
700 | equals = arg.find('=') | |
675 | if equals > -1: |
|
701 | if equals > -1: | |
676 | arg = arg[:equals] |
|
702 | arg = arg[:equals] | |
677 | if arg in aliases: |
|
703 | if arg in aliases: | |
678 | del args[pos] |
|
|||
679 | if equals > -1: |
|
704 | if equals > -1: | |
680 | values.append(fullarg[equals + 1:]) |
|
705 | values.append(fullarg[equals + 1:]) | |
|
706 | if strip: | |||
|
707 | del args[pos] | |||
681 | argcount -= 1 |
|
708 | argcount -= 1 | |
682 | else: |
|
709 | else: | |
|
710 | pos += 1 | |||
|
711 | else: | |||
683 | if pos + 1 >= argcount: |
|
712 | if pos + 1 >= argcount: | |
684 | # ignore and let getopt report an error if there is no value |
|
713 | # ignore and let getopt report an error if there is no value | |
685 | break |
|
714 | break | |
686 |
values.append(args |
|
715 | values.append(args[pos + 1]) | |
|
716 | if strip: | |||
|
717 | del args[pos:pos + 2] | |||
687 | argcount -= 2 |
|
718 | argcount -= 2 | |
|
719 | else: | |||
|
720 | pos += 2 | |||
688 | elif arg[:2] in shortopts: |
|
721 | elif arg[:2] in shortopts: | |
689 | # short option can have no following space, e.g. hg log -Rfoo |
|
722 | # short option can have no following space, e.g. hg log -Rfoo | |
690 |
values.append(args |
|
723 | values.append(args[pos][2:]) | |
|
724 | if strip: | |||
|
725 | del args[pos] | |||
691 | argcount -= 1 |
|
726 | argcount -= 1 | |
692 | else: |
|
727 | else: | |
693 | pos += 1 |
|
728 | pos += 1 | |
|
729 | else: | |||
|
730 | pos += 1 | |||
694 | return values |
|
731 | return values | |
695 |
|
732 | |||
|
733 | def _earlyreqopt(req, name, aliases): | |||
|
734 | """Peek a list option without using a full options table""" | |||
|
735 | values = _earlygetopt(aliases, req.args, strip=False) | |||
|
736 | req.earlyoptions[name] = values | |||
|
737 | return values | |||
|
738 | ||||
|
739 | def _earlyreqoptstr(req, name, aliases): | |||
|
740 | """Peek a string option without using a full options table""" | |||
|
741 | value = (_earlygetopt(aliases, req.args, strip=False) or [''])[-1] | |||
|
742 | req.earlyoptions[name] = value | |||
|
743 | return value | |||
|
744 | ||||
|
745 | def _earlyreqoptbool(req, name, aliases): | |||
|
746 | """Peek a boolean option without using a full options table | |||
|
747 | ||||
|
748 | >>> req = request([b'x', b'--debugger']) | |||
|
749 | >>> _earlyreqoptbool(req, b'debugger', [b'--debugger']) | |||
|
750 | True | |||
|
751 | ||||
|
752 | >>> req = request([b'x', b'--', b'--debugger']) | |||
|
753 | >>> _earlyreqoptbool(req, b'debugger', [b'--debugger']) | |||
|
754 | """ | |||
|
755 | try: | |||
|
756 | argcount = req.args.index("--") | |||
|
757 | except ValueError: | |||
|
758 | argcount = len(req.args) | |||
|
759 | value = None | |||
|
760 | pos = 0 | |||
|
761 | while pos < argcount: | |||
|
762 | arg = req.args[pos] | |||
|
763 | if arg in aliases: | |||
|
764 | value = True | |||
|
765 | pos += 1 | |||
|
766 | req.earlyoptions[name] = value | |||
|
767 | return value | |||
|
768 | ||||
696 | def runcommand(lui, repo, cmd, fullargs, ui, options, d, cmdpats, cmdoptions): |
|
769 | def runcommand(lui, repo, cmd, fullargs, ui, options, d, cmdpats, cmdoptions): | |
697 | # run pre-hook, and abort if it fails |
|
770 | # run pre-hook, and abort if it fails | |
698 | hook.hook(lui, repo, "pre-%s" % cmd, True, args=" ".join(fullargs), |
|
771 | hook.hook(lui, repo, "pre-%s" % cmd, True, args=" ".join(fullargs), | |
@@ -727,8 +800,8 b' def _getlocal(ui, rpath, wd=None):' | |||||
727 | lui = ui.copy() |
|
800 | lui = ui.copy() | |
728 | lui.readconfig(os.path.join(path, ".hg", "hgrc"), path) |
|
801 | lui.readconfig(os.path.join(path, ".hg", "hgrc"), path) | |
729 |
|
802 | |||
730 |
if rpath |
|
803 | if rpath: | |
731 |
path = lui.expandpath(rpath |
|
804 | path = lui.expandpath(rpath) | |
732 | lui = ui.copy() |
|
805 | lui = ui.copy() | |
733 | lui.readconfig(os.path.join(path, ".hg", "hgrc"), path) |
|
806 | lui.readconfig(os.path.join(path, ".hg", "hgrc"), path) | |
734 |
|
807 | |||
@@ -759,6 +832,9 b' def _checkshellalias(lui, ui, args):' | |||||
759 | fn = entry[0] |
|
832 | fn = entry[0] | |
760 |
|
833 | |||
761 | if cmd and util.safehasattr(fn, 'shell'): |
|
834 | if cmd and util.safehasattr(fn, 'shell'): | |
|
835 | # shell alias shouldn't receive early options which are consumed by hg | |||
|
836 | args = args[:] | |||
|
837 | _earlygetopt(commands.earlyoptflags, args, strip=True) | |||
762 | d = lambda: fn(ui, *args[1:]) |
|
838 | d = lambda: fn(ui, *args[1:]) | |
763 | return lambda: runcommand(lui, None, cmd, args[:1], ui, options, d, |
|
839 | return lambda: runcommand(lui, None, cmd, args[:1], ui, options, d, | |
764 | [], {}) |
|
840 | [], {}) | |
@@ -768,11 +844,11 b' def _dispatch(req):' | |||||
768 | ui = req.ui |
|
844 | ui = req.ui | |
769 |
|
845 | |||
770 | # check for cwd |
|
846 | # check for cwd | |
771 |
cwd = _early |
|
847 | cwd = _earlyreqoptstr(req, 'cwd', ['--cwd']) | |
772 | if cwd: |
|
848 | if cwd: | |
773 |
os.chdir(cwd |
|
849 | os.chdir(cwd) | |
774 |
|
850 | |||
775 |
rpath = _early |
|
851 | rpath = _earlyreqoptstr(req, 'repository', ["-R", "--repository", "--repo"]) | |
776 | path, lui = _getlocal(ui, rpath) |
|
852 | path, lui = _getlocal(ui, rpath) | |
777 |
|
853 | |||
778 | uis = {ui, lui} |
|
854 | uis = {ui, lui} | |
@@ -780,7 +856,7 b' def _dispatch(req):' | |||||
780 | if req.repo: |
|
856 | if req.repo: | |
781 | uis.add(req.repo.ui) |
|
857 | uis.add(req.repo.ui) | |
782 |
|
858 | |||
783 | if '--profile' in args: |
|
859 | if _earlyreqoptbool(req, 'profile', ['--profile']): | |
784 | for ui_ in uis: |
|
860 | for ui_ in uis: | |
785 | ui_.setconfig('profiling', 'enabled', 'true', '--profile') |
|
861 | ui_.setconfig('profiling', 'enabled', 'true', '--profile') | |
786 |
|
862 | |||
@@ -812,14 +888,17 b' def _dispatch(req):' | |||||
812 | fullargs = args |
|
888 | fullargs = args | |
813 | cmd, func, args, options, cmdoptions = _parse(lui, args) |
|
889 | cmd, func, args, options, cmdoptions = _parse(lui, args) | |
814 |
|
890 | |||
815 | if options["config"]: |
|
891 | if options["config"] != req.earlyoptions["config"]: | |
816 | raise error.Abort(_("option --config may not be abbreviated!")) |
|
892 | raise error.Abort(_("option --config may not be abbreviated!")) | |
817 | if options["cwd"]: |
|
893 | if options["cwd"] != req.earlyoptions["cwd"]: | |
818 | raise error.Abort(_("option --cwd may not be abbreviated!")) |
|
894 | raise error.Abort(_("option --cwd may not be abbreviated!")) | |
819 | if options["repository"]: |
|
895 | if options["repository"] != req.earlyoptions["repository"]: | |
820 | raise error.Abort(_( |
|
896 | raise error.Abort(_( | |
821 | "option -R has to be separated from other options (e.g. not " |
|
897 | "option -R has to be separated from other options (e.g. not " | |
822 | "-qR) and --repository may only be abbreviated as --repo!")) |
|
898 | "-qR) and --repository may only be abbreviated as --repo!")) | |
|
899 | if options["debugger"] != req.earlyoptions["debugger"]: | |||
|
900 | raise error.Abort(_("option --debugger may not be abbreviated!")) | |||
|
901 | # don't validate --profile/--traceback, which can be enabled from now | |||
823 |
|
902 | |||
824 | if options["encoding"]: |
|
903 | if options["encoding"]: | |
825 | encoding.encoding = options["encoding"] |
|
904 | encoding.encoding = options["encoding"] | |
@@ -908,7 +987,7 b' def _dispatch(req):' | |||||
908 | except error.RequirementError: |
|
987 | except error.RequirementError: | |
909 | raise |
|
988 | raise | |
910 | except error.RepoError: |
|
989 | except error.RepoError: | |
911 |
if rpath |
|
990 | if rpath: # invalid -R path | |
912 | raise |
|
991 | raise | |
913 | if not func.optionalrepo: |
|
992 | if not func.optionalrepo: | |
914 | if func.inferrepo and args and not path: |
|
993 | if func.inferrepo and args and not path: |
@@ -1848,58 +1848,8 b' class localrepository(object):' | |||||
1848 | status.modified.extend(status.clean) # mq may commit clean files |
|
1848 | status.modified.extend(status.clean) # mq may commit clean files | |
1849 |
|
1849 | |||
1850 | # check subrepos |
|
1850 | # check subrepos | |
1851 | subs = [] |
|
1851 | subs, commitsubs, newstate = subrepo.precommit( | |
1852 | commitsubs = set() |
|
1852 | self.ui, wctx, status, match, force=force) | |
1853 | newstate = wctx.substate.copy() |
|
|||
1854 | # only manage subrepos and .hgsubstate if .hgsub is present |
|
|||
1855 | if '.hgsub' in wctx: |
|
|||
1856 | # we'll decide whether to track this ourselves, thanks |
|
|||
1857 | for c in status.modified, status.added, status.removed: |
|
|||
1858 | if '.hgsubstate' in c: |
|
|||
1859 | c.remove('.hgsubstate') |
|
|||
1860 |
|
||||
1861 | # compare current state to last committed state |
|
|||
1862 | # build new substate based on last committed state |
|
|||
1863 | oldstate = wctx.p1().substate |
|
|||
1864 | for s in sorted(newstate.keys()): |
|
|||
1865 | if not match(s): |
|
|||
1866 | # ignore working copy, use old state if present |
|
|||
1867 | if s in oldstate: |
|
|||
1868 | newstate[s] = oldstate[s] |
|
|||
1869 | continue |
|
|||
1870 | if not force: |
|
|||
1871 | raise error.Abort( |
|
|||
1872 | _("commit with new subrepo %s excluded") % s) |
|
|||
1873 | dirtyreason = wctx.sub(s).dirtyreason(True) |
|
|||
1874 | if dirtyreason: |
|
|||
1875 | if not self.ui.configbool('ui', 'commitsubrepos'): |
|
|||
1876 | raise error.Abort(dirtyreason, |
|
|||
1877 | hint=_("use --subrepos for recursive commit")) |
|
|||
1878 | subs.append(s) |
|
|||
1879 | commitsubs.add(s) |
|
|||
1880 | else: |
|
|||
1881 | bs = wctx.sub(s).basestate() |
|
|||
1882 | newstate[s] = (newstate[s][0], bs, newstate[s][2]) |
|
|||
1883 | if oldstate.get(s, (None, None, None))[1] != bs: |
|
|||
1884 | subs.append(s) |
|
|||
1885 |
|
||||
1886 | # check for removed subrepos |
|
|||
1887 | for p in wctx.parents(): |
|
|||
1888 | r = [s for s in p.substate if s not in newstate] |
|
|||
1889 | subs += [s for s in r if match(s)] |
|
|||
1890 | if subs: |
|
|||
1891 | if (not match('.hgsub') and |
|
|||
1892 | '.hgsub' in (wctx.modified() + wctx.added())): |
|
|||
1893 | raise error.Abort( |
|
|||
1894 | _("can't commit subrepos without .hgsub")) |
|
|||
1895 | status.modified.insert(0, '.hgsubstate') |
|
|||
1896 |
|
||||
1897 | elif '.hgsub' in status.removed: |
|
|||
1898 | # clean up .hgsubstate when .hgsub is removed |
|
|||
1899 | if ('.hgsubstate' in wctx and |
|
|||
1900 | '.hgsubstate' not in (status.modified + status.added + |
|
|||
1901 | status.removed)): |
|
|||
1902 | status.removed.insert(0, '.hgsubstate') |
|
|||
1903 |
|
1853 | |||
1904 | # make sure all explicit patterns are matched |
|
1854 | # make sure all explicit patterns are matched | |
1905 | if not force: |
|
1855 | if not force: |
@@ -1233,9 +1233,17 b' def registersummarycallback(repo, otr, t' | |||||
1233 |
|
1233 | |||
1234 | def reportsummary(func): |
|
1234 | def reportsummary(func): | |
1235 | """decorator for report callbacks.""" |
|
1235 | """decorator for report callbacks.""" | |
1236 | reporef = weakref.ref(repo) |
|
1236 | # The repoview life cycle is shorter than the one of the actual | |
|
1237 | # underlying repository. So the filtered object can die before the | |||
|
1238 | # weakref is used leading to troubles. We keep a reference to the | |||
|
1239 | # unfiltered object and restore the filtering when retrieving the | |||
|
1240 | # repository through the weakref. | |||
|
1241 | filtername = repo.filtername | |||
|
1242 | reporef = weakref.ref(repo.unfiltered()) | |||
1237 | def wrapped(tr): |
|
1243 | def wrapped(tr): | |
1238 | repo = reporef() |
|
1244 | repo = reporef() | |
|
1245 | if filtername: | |||
|
1246 | repo = repo.filtered(filtername) | |||
1239 | func(repo, tr) |
|
1247 | func(repo, tr) | |
1240 | newcat = '%2i-txnreport' % len(categories) |
|
1248 | newcat = '%2i-txnreport' % len(categories) | |
1241 | otr.addpostclose(newcat, wrapped) |
|
1249 | otr.addpostclose(newcat, wrapped) |
@@ -293,6 +293,71 b' def submerge(repo, wctx, mctx, actx, ove' | |||||
293 | writestate(repo, sm) |
|
293 | writestate(repo, sm) | |
294 | return sm |
|
294 | return sm | |
295 |
|
295 | |||
|
296 | def precommit(ui, wctx, status, match, force=False): | |||
|
297 | """Calculate .hgsubstate changes that should be applied before committing | |||
|
298 | ||||
|
299 | Returns (subs, commitsubs, newstate) where | |||
|
300 | - subs: changed subrepos (including dirty ones) | |||
|
301 | - commitsubs: dirty subrepos which the caller needs to commit recursively | |||
|
302 | - newstate: new state dict which the caller must write to .hgsubstate | |||
|
303 | ||||
|
304 | This also updates the given status argument. | |||
|
305 | """ | |||
|
306 | subs = [] | |||
|
307 | commitsubs = set() | |||
|
308 | newstate = wctx.substate.copy() | |||
|
309 | ||||
|
310 | # only manage subrepos and .hgsubstate if .hgsub is present | |||
|
311 | if '.hgsub' in wctx: | |||
|
312 | # we'll decide whether to track this ourselves, thanks | |||
|
313 | for c in status.modified, status.added, status.removed: | |||
|
314 | if '.hgsubstate' in c: | |||
|
315 | c.remove('.hgsubstate') | |||
|
316 | ||||
|
317 | # compare current state to last committed state | |||
|
318 | # build new substate based on last committed state | |||
|
319 | oldstate = wctx.p1().substate | |||
|
320 | for s in sorted(newstate.keys()): | |||
|
321 | if not match(s): | |||
|
322 | # ignore working copy, use old state if present | |||
|
323 | if s in oldstate: | |||
|
324 | newstate[s] = oldstate[s] | |||
|
325 | continue | |||
|
326 | if not force: | |||
|
327 | raise error.Abort( | |||
|
328 | _("commit with new subrepo %s excluded") % s) | |||
|
329 | dirtyreason = wctx.sub(s).dirtyreason(True) | |||
|
330 | if dirtyreason: | |||
|
331 | if not ui.configbool('ui', 'commitsubrepos'): | |||
|
332 | raise error.Abort(dirtyreason, | |||
|
333 | hint=_("use --subrepos for recursive commit")) | |||
|
334 | subs.append(s) | |||
|
335 | commitsubs.add(s) | |||
|
336 | else: | |||
|
337 | bs = wctx.sub(s).basestate() | |||
|
338 | newstate[s] = (newstate[s][0], bs, newstate[s][2]) | |||
|
339 | if oldstate.get(s, (None, None, None))[1] != bs: | |||
|
340 | subs.append(s) | |||
|
341 | ||||
|
342 | # check for removed subrepos | |||
|
343 | for p in wctx.parents(): | |||
|
344 | r = [s for s in p.substate if s not in newstate] | |||
|
345 | subs += [s for s in r if match(s)] | |||
|
346 | if subs: | |||
|
347 | if (not match('.hgsub') and | |||
|
348 | '.hgsub' in (wctx.modified() + wctx.added())): | |||
|
349 | raise error.Abort(_("can't commit subrepos without .hgsub")) | |||
|
350 | status.modified.insert(0, '.hgsubstate') | |||
|
351 | ||||
|
352 | elif '.hgsub' in status.removed: | |||
|
353 | # clean up .hgsubstate when .hgsub is removed | |||
|
354 | if ('.hgsubstate' in wctx and | |||
|
355 | '.hgsubstate' not in (status.modified + status.added + | |||
|
356 | status.removed)): | |||
|
357 | status.removed.insert(0, '.hgsubstate') | |||
|
358 | ||||
|
359 | return subs, commitsubs, newstate | |||
|
360 | ||||
296 | def _updateprompt(ui, sub, dirty, local, remote): |
|
361 | def _updateprompt(ui, sub, dirty, local, remote): | |
297 | if dirty: |
|
362 | if dirty: | |
298 | msg = (_(' subrepository sources for %s differ\n' |
|
363 | msg = (_(' subrepository sources for %s differ\n' |
@@ -235,3 +235,97 b' Amend a merge changeset' | |||||
235 | | |
|
235 | | | |
236 | o A |
|
236 | o A | |
237 |
|
237 | |||
|
238 | ||||
|
239 | More complete test for status changes (issue5732) | |||
|
240 | ------------------------------------------------- | |||
|
241 | ||||
|
242 | Generates history of files having 3 states, r0_r1_wc: | |||
|
243 | ||||
|
244 | r0: ground (content/missing) | |||
|
245 | r1: old state to be amended (content/missing, where missing means removed) | |||
|
246 | wc: changes to be included in r1 (content/missing-tracked/untracked) | |||
|
247 | ||||
|
248 | $ hg init $TESTTMP/wcstates | |||
|
249 | $ cd $TESTTMP/wcstates | |||
|
250 | ||||
|
251 | $ $PYTHON $TESTDIR/generate-working-copy-states.py state 2 1 | |||
|
252 | $ hg addremove -q --similarity 0 | |||
|
253 | $ hg commit -m0 | |||
|
254 | ||||
|
255 | $ $PYTHON $TESTDIR/generate-working-copy-states.py state 2 2 | |||
|
256 | $ hg addremove -q --similarity 0 | |||
|
257 | $ hg commit -m1 | |||
|
258 | ||||
|
259 | $ $PYTHON $TESTDIR/generate-working-copy-states.py state 2 wc | |||
|
260 | $ hg addremove -q --similarity 0 | |||
|
261 | $ hg forget *_*_*-untracked | |||
|
262 | $ rm *_*_missing-* | |||
|
263 | ||||
|
264 | amend r1 to include wc changes | |||
|
265 | ||||
|
266 | $ hg amend | |||
|
267 | saved backup bundle to * (glob) (obsstore-off !) | |||
|
268 | ||||
|
269 | clean/modified/removed/added states of the amended revision | |||
|
270 | ||||
|
271 | $ hg status --all --change . 'glob:content1_*_content1-tracked' | |||
|
272 | C content1_content1_content1-tracked | |||
|
273 | C content1_content2_content1-tracked | |||
|
274 | C content1_missing_content1-tracked | |||
|
275 | $ hg status --all --change . 'glob:content1_*_content[23]-tracked' | |||
|
276 | M content1_content1_content3-tracked | |||
|
277 | M content1_content2_content2-tracked | |||
|
278 | M content1_content2_content3-tracked | |||
|
279 | M content1_missing_content3-tracked | |||
|
280 | $ hg status --all --change . 'glob:content1_*_missing-tracked' | |||
|
281 | M content1_content2_missing-tracked | |||
|
282 | R content1_missing_missing-tracked | |||
|
283 | C content1_content1_missing-tracked | |||
|
284 | $ hg status --all --change . 'glob:content1_*_*-untracked' | |||
|
285 | R content1_content1_content1-untracked | |||
|
286 | R content1_content1_content3-untracked | |||
|
287 | R content1_content1_missing-untracked | |||
|
288 | R content1_content2_content1-untracked | |||
|
289 | R content1_content2_content2-untracked | |||
|
290 | R content1_content2_content3-untracked | |||
|
291 | R content1_content2_missing-untracked | |||
|
292 | R content1_missing_content1-untracked | |||
|
293 | R content1_missing_content3-untracked | |||
|
294 | R content1_missing_missing-untracked | |||
|
295 | $ hg status --all --change . 'glob:missing_content2_*' | |||
|
296 | A missing_content2_content2-tracked | |||
|
297 | A missing_content2_content3-tracked | |||
|
298 | A missing_content2_missing-tracked | |||
|
299 | $ hg status --all --change . 'glob:missing_missing_*' | |||
|
300 | A missing_missing_content3-tracked | |||
|
301 | ||||
|
302 | working directory should be all clean (with some missing/untracked files) | |||
|
303 | ||||
|
304 | $ hg status --all 'glob:*_content?-tracked' | |||
|
305 | C content1_content1_content1-tracked | |||
|
306 | C content1_content1_content3-tracked | |||
|
307 | C content1_content2_content1-tracked | |||
|
308 | C content1_content2_content2-tracked | |||
|
309 | C content1_content2_content3-tracked | |||
|
310 | C content1_missing_content1-tracked | |||
|
311 | C content1_missing_content3-tracked | |||
|
312 | C missing_content2_content2-tracked | |||
|
313 | C missing_content2_content3-tracked | |||
|
314 | C missing_missing_content3-tracked | |||
|
315 | $ hg status --all 'glob:*_missing-tracked' | |||
|
316 | ! content1_content1_missing-tracked | |||
|
317 | ! content1_content2_missing-tracked | |||
|
318 | ! content1_missing_missing-tracked | |||
|
319 | ! missing_content2_missing-tracked | |||
|
320 | ! missing_missing_missing-tracked | |||
|
321 | $ hg status --all 'glob:*-untracked' | |||
|
322 | ? content1_content1_content1-untracked | |||
|
323 | ? content1_content1_content3-untracked | |||
|
324 | ? content1_content2_content1-untracked | |||
|
325 | ? content1_content2_content2-untracked | |||
|
326 | ? content1_content2_content3-untracked | |||
|
327 | ? content1_missing_content1-untracked | |||
|
328 | ? content1_missing_content3-untracked | |||
|
329 | ? missing_content2_content2-untracked | |||
|
330 | ? missing_content2_content3-untracked | |||
|
331 | ? missing_missing_content3-untracked |
@@ -19,7 +19,7 b' command, exit codes, and duration' | |||||
19 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> init blackboxtest exited 0 after * seconds (glob) |
|
19 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> init blackboxtest exited 0 after * seconds (glob) | |
20 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> add a |
|
20 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> add a | |
21 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> add a exited 0 after * seconds (glob) |
|
21 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> add a exited 0 after * seconds (glob) | |
22 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000+ (5000)> blackbox |
|
22 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000+ (5000)> blackbox --config *blackbox.dirty=True* (glob) | |
23 |
|
23 | |||
24 | alias expansion is logged |
|
24 | alias expansion is logged | |
25 | $ rm ./.hg/blackbox.log |
|
25 | $ rm ./.hg/blackbox.log |
@@ -261,7 +261,7 b' divergent bookmarks' | |||||
261 | Z 1:0d2164f0ce0d |
|
261 | Z 1:0d2164f0ce0d | |
262 |
|
262 | |||
263 | $ cd ../b |
|
263 | $ cd ../b | |
264 |
$ hg up |
|
264 | $ hg up | |
265 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
265 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
266 | updating bookmark foobar |
|
266 | updating bookmark foobar | |
267 | $ echo c2 > f2 |
|
267 | $ echo c2 > f2 |
@@ -30,6 +30,89 b' Missing arg:' | |||||
30 | (use 'hg cat -h' to show more help) |
|
30 | (use 'hg cat -h' to show more help) | |
31 | [255] |
|
31 | [255] | |
32 |
|
32 | |||
|
33 | Missing parameter for early option: | |||
|
34 | ||||
|
35 | $ hg log -R 2>&1 | grep 'hg log' | |||
|
36 | hg log: option -R requires argument | |||
|
37 | hg log [OPTION]... [FILE] | |||
|
38 | (use 'hg log -h' to show more help) | |||
|
39 | ||||
|
40 | $ hg log -R -- 2>&1 | grep 'hg log' | |||
|
41 | hg log: option -R requires argument | |||
|
42 | hg log [OPTION]... [FILE] | |||
|
43 | (use 'hg log -h' to show more help) | |||
|
44 | ||||
|
45 | Parsing of early options should stop at "--": | |||
|
46 | ||||
|
47 | $ hg cat -- --config=hooks.pre-cat=false | |||
|
48 | --config=hooks.pre-cat=false: no such file in rev cb9a9f314b8b | |||
|
49 | [1] | |||
|
50 | $ hg cat -- --debugger | |||
|
51 | --debugger: no such file in rev cb9a9f314b8b | |||
|
52 | [1] | |||
|
53 | ||||
|
54 | Unparsable form of early options: | |||
|
55 | ||||
|
56 | $ hg cat --debugg | |||
|
57 | abort: option --debugger may not be abbreviated! | |||
|
58 | [255] | |||
|
59 | ||||
|
60 | Parsing failure of early options should be detected before executing the | |||
|
61 | command: | |||
|
62 | ||||
|
63 | $ hg log -b '--config=hooks.pre-log=false' default | |||
|
64 | abort: option --config may not be abbreviated! | |||
|
65 | [255] | |||
|
66 | $ hg log -b -R. default | |||
|
67 | abort: option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo! | |||
|
68 | [255] | |||
|
69 | $ hg log --cwd .. -b --cwd=. default | |||
|
70 | abort: option --cwd may not be abbreviated! | |||
|
71 | [255] | |||
|
72 | ||||
|
73 | However, we can't prevent it from loading extensions and configs: | |||
|
74 | ||||
|
75 | $ cat <<EOF > bad.py | |||
|
76 | > raise Exception('bad') | |||
|
77 | > EOF | |||
|
78 | $ hg log -b '--config=extensions.bad=bad.py' default | |||
|
79 | *** failed to import extension bad from bad.py: bad | |||
|
80 | abort: option --config may not be abbreviated! | |||
|
81 | [255] | |||
|
82 | ||||
|
83 | $ mkdir -p badrepo/.hg | |||
|
84 | $ echo 'invalid-syntax' > badrepo/.hg/hgrc | |||
|
85 | $ hg log -b -Rbadrepo default | |||
|
86 | hg: parse error at badrepo/.hg/hgrc:1: invalid-syntax | |||
|
87 | [255] | |||
|
88 | ||||
|
89 | $ hg log -b --cwd=inexistent default | |||
|
90 | abort: No such file or directory: 'inexistent' | |||
|
91 | [255] | |||
|
92 | ||||
|
93 | $ hg log -b '--config=ui.traceback=yes' 2>&1 | grep '^Traceback' | |||
|
94 | Traceback (most recent call last): | |||
|
95 | $ hg log -b '--config=profiling.enabled=yes' 2>&1 | grep -i sample | |||
|
96 | Sample count: .*|No samples recorded\. (re) | |||
|
97 | ||||
|
98 | Early options can't be specified in [aliases] and [defaults] because they are | |||
|
99 | applied before the command name is resolved: | |||
|
100 | ||||
|
101 | $ hg log -b '--config=alias.log=log --config=hooks.pre-log=false' | |||
|
102 | hg log: option -b not recognized | |||
|
103 | error in definition for alias 'log': --config may only be given on the command | |||
|
104 | line | |||
|
105 | [255] | |||
|
106 | ||||
|
107 | $ hg log -b '--config=defaults.log=--config=hooks.pre-log=false' | |||
|
108 | abort: option --config may not be abbreviated! | |||
|
109 | [255] | |||
|
110 | ||||
|
111 | Shell aliases bypass any command parsing rules but for the early one: | |||
|
112 | ||||
|
113 | $ hg log -b '--config=alias.log=!echo howdy' | |||
|
114 | howdy | |||
|
115 | ||||
33 | [defaults] |
|
116 | [defaults] | |
34 |
|
117 | |||
35 | $ hg cat a |
|
118 | $ hg cat a |
@@ -233,9 +233,10 b' add another largefile to the new largefi' | |||||
233 | $ cd .. |
|
233 | $ cd .. | |
234 |
|
234 | |||
235 | round-trip: converting back to a normal (non-largefiles) repo with |
|
235 | round-trip: converting back to a normal (non-largefiles) repo with | |
236 | "lfconvert --to-normal" should give the same as ../bigfile-repo |
|
236 | "lfconvert --to-normal" should give the same as ../bigfile-repo. The | |
|
237 | convert extension is disabled to show config items can be loaded without it. | |||
237 | $ cd largefiles-repo |
|
238 | $ cd largefiles-repo | |
238 | $ hg lfconvert --to-normal . ../normal-repo |
|
239 | $ hg --config extensions.convert=! lfconvert --to-normal . ../normal-repo | |
239 | initializing destination ../normal-repo |
|
240 | initializing destination ../normal-repo | |
240 | 0 additional largefiles cached |
|
241 | 0 additional largefiles cached | |
241 | scanning source... |
|
242 | scanning source... |
@@ -61,7 +61,7 b' A deleted subrepo file is flagged as dir' | |||||
61 | 9bfe45a197d7+ tip |
|
61 | 9bfe45a197d7+ tip | |
62 | $ cat .hg/blackbox.log |
|
62 | $ cat .hg/blackbox.log | |
63 | * @9bfe45a197d7b0ab09bf287729dd57e9619c9da5+ (*)> serve --cmdserver chgunix * (glob) (chg !) |
|
63 | * @9bfe45a197d7b0ab09bf287729dd57e9619c9da5+ (*)> serve --cmdserver chgunix * (glob) (chg !) | |
64 | * @9bfe45a197d7b0ab09bf287729dd57e9619c9da5+ (*)> id (glob) |
|
64 | * @9bfe45a197d7b0ab09bf287729dd57e9619c9da5+ (*)> id --config *extensions.blackbox=* --config *blackbox.dirty=True* (glob) | |
65 | * @9bfe45a197d7b0ab09bf287729dd57e9619c9da5+ (*)> id --config *extensions.blackbox=* --config *blackbox.dirty=True* exited 0 * (glob) |
|
65 | * @9bfe45a197d7b0ab09bf287729dd57e9619c9da5+ (*)> id --config *extensions.blackbox=* --config *blackbox.dirty=True* exited 0 * (glob) | |
66 |
|
66 | |||
67 | TODO: a deleted file should be listed as such, like the top level repo |
|
67 | TODO: a deleted file should be listed as such, like the top level repo |
@@ -17,7 +17,7 b' Function to test discovery between two r' | |||||
17 | > hg -R a debugdiscovery b --verbose --debug --config progress.debug=true |
|
17 | > hg -R a debugdiscovery b --verbose --debug --config progress.debug=true | |
18 | > echo |
|
18 | > echo | |
19 | > echo "% -- b -> a tree" |
|
19 | > echo "% -- b -> a tree" | |
20 |
> hg -R b debugdiscovery a --verbose --old |
|
20 | > hg -R b debugdiscovery a --verbose --old | |
21 | > echo |
|
21 | > echo | |
22 | > echo "% -- b -> a set" |
|
22 | > echo "% -- b -> a set" | |
23 | > hg -R b debugdiscovery a --verbose --debug --config progress.debug=true |
|
23 | > hg -R b debugdiscovery a --verbose --debug --config progress.debug=true | |
@@ -406,8 +406,8 b' fixed in 86c35b7ae300:' | |||||
406 | 101 102 103 104 105 106 107 108 109 110 (no-eol) |
|
406 | 101 102 103 104 105 106 107 108 109 110 (no-eol) | |
407 | $ hg -R r1 --config extensions.blackbox= blackbox |
|
407 | $ hg -R r1 --config extensions.blackbox= blackbox | |
408 | * @5d0b986a083e0d91f116de4691e2aaa54d5bbec0 (*)> serve --cmdserver chgunix * (glob) (chg !) |
|
408 | * @5d0b986a083e0d91f116de4691e2aaa54d5bbec0 (*)> serve --cmdserver chgunix * (glob) (chg !) | |
409 | * @5d0b986a083e0d91f116de4691e2aaa54d5bbec0 (*)> outgoing r2 *-T{rev} * (glob) |
|
409 | * @5d0b986a083e0d91f116de4691e2aaa54d5bbec0 (*)> -R r1 outgoing r2 *-T{rev} * --config *extensions.blackbox=* (glob) | |
410 | * @5d0b986a083e0d91f116de4691e2aaa54d5bbec0 (*)> found 101 common and 1 unknown server heads, 2 roundtrips in *.????s (glob) |
|
410 | * @5d0b986a083e0d91f116de4691e2aaa54d5bbec0 (*)> found 101 common and 1 unknown server heads, 2 roundtrips in *.????s (glob) | |
411 | * @5d0b986a083e0d91f116de4691e2aaa54d5bbec0 (*)> -R r1 outgoing r2 *-T{rev} * --config *extensions.blackbox=* exited 0 after *.?? seconds (glob) |
|
411 | * @5d0b986a083e0d91f116de4691e2aaa54d5bbec0 (*)> -R r1 outgoing r2 *-T{rev} * --config *extensions.blackbox=* exited 0 after *.?? seconds (glob) | |
412 | * @5d0b986a083e0d91f116de4691e2aaa54d5bbec0 (*)> blackbox (glob) |
|
412 | * @5d0b986a083e0d91f116de4691e2aaa54d5bbec0 (*)> -R r1 --config *extensions.blackbox=* blackbox (glob) | |
413 | $ cd .. |
|
413 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now