hgext3rd/evolve/utility.py
author Pierre-Yves David <pierre-yves.david@octobus.net>
Sun, 23 Jul 2017 05:42:41 +0200
changeset 2763 4a5b0c373e65
parent 2125 e0a25339ff17
child 3309 09db38b34cb9
permissions -rw-r--r--
commands: move the touch to the 'evocommands' module
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2047
ce39d0f9976d serveronly: give the sub extension a way to access to the 'evolve' module
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     1
# Various utility function for the evolve extension
ce39d0f9976d serveronly: give the sub extension a way to access to the 'evolve' module
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     2
#
ce39d0f9976d serveronly: give the sub extension a way to access to the 'evolve' module
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     3
# Copyright 2017 Pierre-Yves David <pierre-yves.david@ens-lyon.org>
ce39d0f9976d serveronly: give the sub extension a way to access to the 'evolve' module
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     4
#
ce39d0f9976d serveronly: give the sub extension a way to access to the 'evolve' module
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     5
# This software may be used and distributed according to the terms of the
ce39d0f9976d serveronly: give the sub extension a way to access to the 'evolve' module
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     6
# GNU General Public License version 2 or any later version.
ce39d0f9976d serveronly: give the sub extension a way to access to the 'evolve' module
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     7
2763
4a5b0c373e65 commands: move the touch to the 'evocommands' module
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 2125
diff changeset
     8
shorttemplate = "[{label('evolve.rev', rev)}] {desc|firstline}\n"
4a5b0c373e65 commands: move the touch to the 'evocommands' module
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 2125
diff changeset
     9
2047
ce39d0f9976d serveronly: give the sub extension a way to access to the 'evolve' module
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    10
def obsexcmsg(ui, message, important=False):
ce39d0f9976d serveronly: give the sub extension a way to access to the 'evolve' module
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    11
    verbose = ui.configbool('experimental', 'verbose-obsolescence-exchange',
ce39d0f9976d serveronly: give the sub extension a way to access to the 'evolve' module
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    12
                            False)
ce39d0f9976d serveronly: give the sub extension a way to access to the 'evolve' module
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    13
    if verbose:
ce39d0f9976d serveronly: give the sub extension a way to access to the 'evolve' module
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    14
        message = 'OBSEXC: ' + message
ce39d0f9976d serveronly: give the sub extension a way to access to the 'evolve' module
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    15
    if important or verbose:
ce39d0f9976d serveronly: give the sub extension a way to access to the 'evolve' module
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    16
        ui.status(message)
2054
f9d65d24b9f9 discovery: split discovery related code in 'obsdiscovery'
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2047
diff changeset
    17
f9d65d24b9f9 discovery: split discovery related code in 'obsdiscovery'
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2047
diff changeset
    18
def obsexcprg(ui, *args, **kwargs):
f9d65d24b9f9 discovery: split discovery related code in 'obsdiscovery'
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2047
diff changeset
    19
    topic = 'obsmarkers exchange'
f9d65d24b9f9 discovery: split discovery related code in 'obsdiscovery'
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2047
diff changeset
    20
    if ui.configbool('experimental', 'verbose-obsolescence-exchange', False):
f9d65d24b9f9 discovery: split discovery related code in 'obsdiscovery'
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2047
diff changeset
    21
        topic = 'OBSEXC'
f9d65d24b9f9 discovery: split discovery related code in 'obsdiscovery'
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2047
diff changeset
    22
    ui.progress(topic, *args, **kwargs)