Mercurial > python-hglib
annotate hglib/merge.py @ 127:53387d1e620b
client: connect to repo if necessary when using "with" statement
While the '__exit__' closes the connection to the server, the __enter__ method
does not open it. Without this patch, a disconnected repo cannot be used with a
context managed unless you explicitely call the "open" method.
author | Paul Tonelli <paul.tonelli@logilab.fr> |
---|---|
date | Mon, 16 Jun 2014 18:29:06 +0200 |
parents | ebcc5d7dd528 |
children | fe74d5599539 |
rev | line source |
---|---|
46
ebcc5d7dd528
client: introduce merge handlers
Idan Kamara <idankk86@gmail.com>
parents:
diff
changeset
|
1 class handlers(object): |
ebcc5d7dd528
client: introduce merge handlers
Idan Kamara <idankk86@gmail.com>
parents:
diff
changeset
|
2 """ |
ebcc5d7dd528
client: introduce merge handlers
Idan Kamara <idankk86@gmail.com>
parents:
diff
changeset
|
3 These can be used as the cb argument to hgclient.merge() to control the |
ebcc5d7dd528
client: introduce merge handlers
Idan Kamara <idankk86@gmail.com>
parents:
diff
changeset
|
4 behaviour when Mercurial prompts what to do with regard to a specific file, |
ebcc5d7dd528
client: introduce merge handlers
Idan Kamara <idankk86@gmail.com>
parents:
diff
changeset
|
5 e.g. when one parent modified a file and the other removed it. |
ebcc5d7dd528
client: introduce merge handlers
Idan Kamara <idankk86@gmail.com>
parents:
diff
changeset
|
6 """ |
ebcc5d7dd528
client: introduce merge handlers
Idan Kamara <idankk86@gmail.com>
parents:
diff
changeset
|
7 |
ebcc5d7dd528
client: introduce merge handlers
Idan Kamara <idankk86@gmail.com>
parents:
diff
changeset
|
8 @staticmethod |
ebcc5d7dd528
client: introduce merge handlers
Idan Kamara <idankk86@gmail.com>
parents:
diff
changeset
|
9 def abort(size, output): |
ebcc5d7dd528
client: introduce merge handlers
Idan Kamara <idankk86@gmail.com>
parents:
diff
changeset
|
10 """ |
ebcc5d7dd528
client: introduce merge handlers
Idan Kamara <idankk86@gmail.com>
parents:
diff
changeset
|
11 Abort the merge if a prompt appears. |
ebcc5d7dd528
client: introduce merge handlers
Idan Kamara <idankk86@gmail.com>
parents:
diff
changeset
|
12 """ |
ebcc5d7dd528
client: introduce merge handlers
Idan Kamara <idankk86@gmail.com>
parents:
diff
changeset
|
13 return '' |
ebcc5d7dd528
client: introduce merge handlers
Idan Kamara <idankk86@gmail.com>
parents:
diff
changeset
|
14 |
ebcc5d7dd528
client: introduce merge handlers
Idan Kamara <idankk86@gmail.com>
parents:
diff
changeset
|
15 """ |
ebcc5d7dd528
client: introduce merge handlers
Idan Kamara <idankk86@gmail.com>
parents:
diff
changeset
|
16 This corresponds to Mercurial's -y/--noninteractive global option, which |
ebcc5d7dd528
client: introduce merge handlers
Idan Kamara <idankk86@gmail.com>
parents:
diff
changeset
|
17 picks the first choice on all prompts. |
ebcc5d7dd528
client: introduce merge handlers
Idan Kamara <idankk86@gmail.com>
parents:
diff
changeset
|
18 """ |
ebcc5d7dd528
client: introduce merge handlers
Idan Kamara <idankk86@gmail.com>
parents:
diff
changeset
|
19 noninteractive = 'yes' |