/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

More work on roundtrip push support.

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
 
18
20
import urllib
19
21
 
20
22
def format_hg_metadata(renames, branch, extra):
34
36
            extra_message += "rename : " + oldfile + " => " + newfile + "\n"
35
37
 
36
38
    for key, value in extra.iteritems():
37
 
        if key in ('author', 'committer', 'encoding', 'message', 'branch', 'hg-git'):
 
39
        if key in ('author', 'committer', 'encoding', 'message', 'branch',
 
40
                   'hg-git'):
38
41
            continue
39
42
        else:
40
43
            extra_message += "extra : " + key + " : " +  urllib.quote(value) + "\n"
49
52
    """Extract Mercurial metadata from a commit message.
50
53
 
51
54
    :param message: Commit message to extract from
52
 
    :return: Tuple with original commit message, renames, branch and 
 
55
    :return: Tuple with original commit message, renames, branch and
53
56
        extra data.
54
57
    """
55
58
    split = message.split("\n--HG--\n", 1)