##// END OF EJS Templates
absorb: update commit hash references in the new commits...
Matt Harbison -
r46304:0a330055 default
parent child Browse files
Show More
@@ -244,7 +244,7 b' class overlaystore(patch.filestore):'
244 return content, mode, copy
244 return content, mode, copy
245
245
246
246
247 def overlaycontext(memworkingcopy, ctx, parents=None, extra=None):
247 def overlaycontext(memworkingcopy, ctx, parents=None, extra=None, desc=None):
248 """({path: content}, ctx, (p1node, p2node)?, {}?) -> memctx
248 """({path: content}, ctx, (p1node, p2node)?, {}?) -> memctx
249 memworkingcopy overrides file contents.
249 memworkingcopy overrides file contents.
250 """
250 """
@@ -253,8 +253,9 b' def overlaycontext(memworkingcopy, ctx, '
253 parents = ctx.repo().changelog.parents(ctx.node())
253 parents = ctx.repo().changelog.parents(ctx.node())
254 if extra is None:
254 if extra is None:
255 extra = ctx.extra()
255 extra = ctx.extra()
256 if desc is None:
257 desc = ctx.description()
256 date = ctx.date()
258 date = ctx.date()
257 desc = ctx.description()
258 user = ctx.user()
259 user = ctx.user()
259 files = set(ctx.files()).union(memworkingcopy)
260 files = set(ctx.files()).union(memworkingcopy)
260 store = overlaystore(ctx, memworkingcopy)
261 store = overlaystore(ctx, memworkingcopy)
@@ -923,7 +924,18 b' class fixupstate(object):'
923 extra = ctx.extra()
924 extra = ctx.extra()
924 if self._useobsolete and self.ui.configbool(b'absorb', b'add-noise'):
925 if self._useobsolete and self.ui.configbool(b'absorb', b'add-noise'):
925 extra[b'absorb_source'] = ctx.hex()
926 extra[b'absorb_source'] = ctx.hex()
926 mctx = overlaycontext(memworkingcopy, ctx, parents, extra=extra)
927
928 desc = rewriteutil.update_hash_refs(
929 ctx.repo(),
930 ctx.description(),
931 {
932 oldnode: [newnode]
933 for oldnode, newnode in self.replacemap.items()
934 },
935 )
936 mctx = overlaycontext(
937 memworkingcopy, ctx, parents, extra=extra, desc=desc
938 )
927 return mctx.commit()
939 return mctx.commit()
928
940
929 @util.propertycache
941 @util.propertycache
@@ -603,21 +603,21 b' This should move us to the non-obsolete '
603 $ hg commit -m a -A a b
603 $ hg commit -m a -A a b
604 $ hg branch foo -q
604 $ hg branch foo -q
605 $ echo b > b
605 $ echo b > b
606 $ hg commit -m foo # will become empty
606 $ hg commit -m 'foo (child of 0cde1ae39321)' # will become empty
607 $ hg branch bar -q
607 $ hg branch bar -q
608 $ hg commit -m bar # is already empty
608 $ hg commit -m 'bar (child of e969dc86aefc)' # is already empty
609 $ echo a2 > a
609 $ echo a2 > a
610 $ printf '' > b
610 $ printf '' > b
611 $ hg absorb --apply-changes --verbose | grep became
611 $ hg absorb --apply-changes --verbose | grep became
612 0:0cde1ae39321: 1 file(s) changed, became 3:fc7fcdd90fdb
612 0:0cde1ae39321: 1 file(s) changed, became 3:fc7fcdd90fdb
613 1:795dfb1adcef: 2 file(s) changed, became 4:a8740537aa53
613 1:e969dc86aefc: 2 file(s) changed, became 4:8fc6b2cb43a5
614 2:b02935f68891: 2 file(s) changed, became 5:59533e01c707
614 2:0298954ced32: 2 file(s) changed, became 5:ca8386dc4e2c
615 $ hg log -T '{rev} (branch: {branch}) {desc}\n' -G --stat
615 $ hg log -T '{rev}:{node|short} (branch: {branch}) {desc}\n' -G --stat
616 @ 5 (branch: bar) bar
616 @ 5:ca8386dc4e2c (branch: bar) bar (child of 8fc6b2cb43a5)
617 |
617 |
618 o 4 (branch: foo) foo
618 o 4:8fc6b2cb43a5 (branch: foo) foo (child of fc7fcdd90fdb)
619 |
619 |
620 o 3 (branch: default) a
620 o 3:fc7fcdd90fdb (branch: default) a
621 a | 1 +
621 a | 1 +
622 b | 0
622 b | 0
623 2 files changed, 1 insertions(+), 0 deletions(-)
623 2 files changed, 1 insertions(+), 0 deletions(-)
General Comments 0
You need to be logged in to leave comments. Login now