Commits

Steve Borho committed c53172b

partialcommit: pass canonical paths to patch.makememctx()

This makes partial commits finally functional, but it effectively removes any
files which were not partially selected (if they are in the commit file list
but aren't described in the patch, hg considers them deleted).

Comments (0)

Files changed (1)

tortoisehg/hgqt/partialcommit.py

 import cStringIO
 
 from mercurial.i18n import _
-from mercurial import patch, commands, extensions
+from mercurial import patch, commands, extensions, scmutil
 
 def partialcommit(orig, ui, repo, *pats, **opts):
     if 'partials' not in opts:
         # Let --subrepos on the command line override config setting.
         ui.setconfig('ui', 'commitsubrepos', True)
 
+    files = [scmutil.canonpath(repo.root, repo.root, f) for f in pats]
+
     patchfile = opts['partials']
     fp = open(patchfile, 'rb')
 
         # create new revision from memory
         memctx = patch.makememctx(repo, (pctx.node(), None), opts['message'],
                                   opts.get('user'), opts.get('date'), branch,
-                                  pats, store)
+                                  files, store)
 
         if opts.get('close_branch'):
             if pctx.node() not in repo.branchheads():