equal
deleted
inserted
replaced
24 util, |
24 util, |
25 ) |
25 ) |
26 |
26 |
27 |
27 |
28 NODE_RE = re.compile(br'\b[0-9a-f]{6,64}\b') |
28 NODE_RE = re.compile(br'\b[0-9a-f]{6,64}\b') |
|
29 |
|
30 # set of extra entry that should survive a rebase-like operation, extensible by extensions |
|
31 retained_extras_on_rebase = { |
|
32 b'source', |
|
33 b'intermediate-source', |
|
34 } |
|
35 |
|
36 |
|
37 def preserve_extras_on_rebase(old_ctx, new_extra): |
|
38 """preserve the relevant `extra` entry from old_ctx on rebase-like operation""" |
|
39 new_extra.update( |
|
40 (key, value) |
|
41 for key, value in old_ctx.extra().items() |
|
42 if key in retained_extras_on_rebase |
|
43 ) |
29 |
44 |
30 |
45 |
31 def _formatrevs(repo, revs, maxrevs=4): |
46 def _formatrevs(repo, revs, maxrevs=4): |
32 """returns a string summarizing revisions in a decent size |
47 """returns a string summarizing revisions in a decent size |
33 |
48 |