/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to hg.py

Run bzrlib foreign tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
# along with this program; if not, write to the Free Software
16
16
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
17
 
18
 
"""Compatibility for hg-git."""
19
 
 
20
18
import urllib
21
19
 
22
20
def format_hg_metadata(renames, branch, extra):
36
34
            extra_message += "rename : " + oldfile + " => " + newfile + "\n"
37
35
 
38
36
    for key, value in extra.iteritems():
39
 
        if key in ('author', 'committer', 'encoding', 'message', 'branch',
40
 
                   'hg-git'):
 
37
        if key in ('author', 'committer', 'encoding', 'message', 'branch', 'hg-git'):
41
38
            continue
42
39
        else:
43
40
            extra_message += "extra : " + key + " : " +  urllib.quote(value) + "\n"
52
49
    """Extract Mercurial metadata from a commit message.
53
50
 
54
51
    :param message: Commit message to extract from
55
 
    :return: Tuple with original commit message, renames, branch and
 
52
    :return: Tuple with original commit message, renames, branch and 
56
53
        extra data.
57
54
    """
58
55
    split = message.split("\n--HG--\n", 1)