Mercurial > public > mercurial-scm > hg-stable
diff hgext/histedit.py @ 25809:ebb5bb9bc32e
histedit: mark temporary commits as obsolete when allowed to
Before this patch, we were stripping temporary commits at the end of a histedit
whether it was successful or not. If we can create obs markers, we should
create them instead of stripping because it is faster and safer.
author | Laurent Charignon <lcharignon@fb.com> |
---|---|
date | Thu, 16 Jul 2015 11:12:15 -0700 |
parents | 425839c8ec79 |
children | 8e77e8338cae |
line wrap: on
line diff
--- a/hgext/histedit.py Thu Jul 16 11:17:37 2015 -0700 +++ b/hgext/histedit.py Thu Jul 16 11:12:15 2015 -0700 @@ -797,8 +797,13 @@ break else: pass - cleanupnode(ui, repo, 'created', tmpnodes) - cleanupnode(ui, repo, 'temp', leafs) + if supportsmarkers: + obsolete.createmarkers(repo, + ((repo[t],()) for t in sorted(tmpnodes))) + obsolete.createmarkers(repo, ((repo[t],()) for t in sorted(leafs))) + else: + cleanupnode(ui, repo, 'created', tmpnodes) + cleanupnode(ui, repo, 'temp', leafs) state.clear() return else: @@ -893,8 +898,10 @@ obsolete.createmarkers(repo, markers) else: cleanupnode(ui, repo, 'replaced', mapping) - - cleanupnode(ui, repo, 'temp', tmpnodes) + if supportsmarkers: + obsolete.createmarkers(repo, ((repo[t],()) for t in sorted(tmpnodes))) + else: + cleanupnode(ui, repo, 'temp', tmpnodes) state.clear() if os.path.exists(repo.sjoin('undo')): os.unlink(repo.sjoin('undo'))