Merge lp:~jelmer/brz/rebase-source into lp:brz

Proposed by Jelmer Vernooij
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: no longer in the source branch.
Merge reported by: The Breezy Bot
Merged at revision: not available
Proposed branch: lp:~jelmer/brz/rebase-source
Merge into: lp:brz
Diff against target: 60 lines (+14/-4)
2 files modified
breezy/git/mapping.py (+13/-3)
breezy/git/tests/test_mapping.py (+1/-1)
To merge this branch: bzr merge lp:~jelmer/brz/rebase-source
Reviewer Review Type Date Requested Status
Jelmer Vernooij Approve
Review via email: mp+422589@code.launchpad.net

Commit message

git: Improve handling of mercurial magic.

Description of the change

Improve handling of mercurial magic.

To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) :
review: Approve
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote :
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote :
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote :
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'breezy/git/mapping.py'
2--- breezy/git/mapping.py 2022-01-16 18:15:58 +0000
3+++ breezy/git/mapping.py 2022-07-04 08:43:38 +0000
4@@ -58,6 +58,12 @@
5
6 # This HG extra is used to indicate the commit that this commit was based on.
7 HG_EXTRA_AMEND_SOURCE = b"amend_source"
8+HG_EXTRA_REBASE_SOURCE = b"rebase_source"
9+HG_EXTRA_ABSORB_SOURCE = b"absorb_source"
10+HG_EXTRA_SOURCE = b"source"
11+HG_EXTRA_INTERMEDIATE_SOURCE = b"intermediate-source"
12+HG_EXTRA_TOPIC = b"topic"
13+HG_EXTRA_REWRITE_NOISE = b"_rewrite_noise"
14
15 FILE_ID_PREFIX = b'git:'
16
17@@ -363,7 +369,8 @@
18 i = 0
19 propname = u'git-mergetag-0'
20 while propname in rev.properties:
21- commit.mergetag.append(Tag.from_string(rev.properties[propname]))
22+ commit.mergetag.append(
23+ Tag.from_string(rev.properties[propname].encode('utf-8', 'surrogateescape')))
24 i += 1
25 propname = u'git-mergetag-%d' % i
26 if u'git-extra' in rev.properties:
27@@ -436,7 +443,7 @@
28 'utf-8', 'surrogateescape')
29 if commit.mergetag:
30 for i, tag in enumerate(commit.mergetag):
31- rev.properties[u'git-mergetag-%d' % i] = tag.as_raw_string()
32+ rev.properties[u'git-mergetag-%d' % i] = tag.as_raw_string().decode('utf-8', 'surrogateescape')
33 rev.timestamp = commit.commit_time
34 rev.timezone = commit.commit_timezone
35 rev.parent_ids = None
36@@ -467,7 +474,10 @@
37 v.decode('utf-8', 'surrogateescape') + '\n')
38 elif k == HG_EXTRA:
39 hgk, hgv = v.split(b':', 1)
40- if hgk not in (HG_EXTRA_AMEND_SOURCE, ) and strict:
41+ if hgk not in (HG_EXTRA_AMEND_SOURCE, HG_EXTRA_REBASE_SOURCE,
42+ HG_EXTRA_ABSORB_SOURCE, HG_EXTRA_INTERMEDIATE_SOURCE,
43+ HG_EXTRA_SOURCE, HG_EXTRA_TOPIC,
44+ HG_EXTRA_REWRITE_NOISE) and strict:
45 raise UnknownMercurialCommitExtra(commit, [hgk])
46 extra_lines.append(
47 k.decode('utf-8', 'surrogateescape') + ' ' +
48
49=== modified file 'breezy/git/tests/test_mapping.py'
50--- breezy/git/tests/test_mapping.py 2022-01-12 23:40:12 +0000
51+++ breezy/git/tests/test_mapping.py 2022-07-04 08:43:38 +0000
52@@ -235,7 +235,7 @@
53 rev, roundtrip_revid, verifiers = mapping.import_commit(
54 c, mapping.revision_id_foreign_to_bzr)
55 self.assertEqual(
56- rev.properties[u'git-mergetag-0'], tag.as_raw_string())
57+ rev.properties[u'git-mergetag-0'].encode('utf-8'), tag.as_raw_string())
58
59 def test_unknown_hg_fields(self):
60 c = Commit()

Subscribers

People subscribed via source and target branches