Skip to content
This repository has been archived by the owner on Apr 12, 2019. It is now read-only.

mgax/hgPatcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

hgPatcher

hgPatcher is code from Mercurial, stripped and hacked. Its purpose is to apply patches, in unified diff format, to in-memory strings. For now it can only handle patches that change a single file. The code is liable to break in interesting ways, but it should not touch anything on-disk, so it's safe to use in a try-except block:

>>> try:
...     import hgpatcher
...     out_str = hgpatcher(patch_str, in_str)
... except Exception, e:
...     print "patch failed: %r" % e
... else:
...     print out_str

About

Repackaging of Mercurial's patch code

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages