Patchwork [3,of,5,relative-diff] patch.trydiff: add a docstring

login
register
mail settings
Submitter Siddharth Agarwal
Date March 17, 2015, 10:57 p.m.
Message ID <194f4ddf99b761fbb2bc.1426633048@devbig136.prn2.facebook.com>
Download mbox | patch
Permalink /patch/8132/
State Accepted
Commit 8a997bd734480f0039025e67afd3cdefa654edd8
Headers show

Comments

Siddharth Agarwal - March 17, 2015, 10:57 p.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1426622775 25200
#      Tue Mar 17 13:06:15 2015 -0700
# Node ID 194f4ddf99b761fbb2bc883cc93629ecc09c0c84
# Parent  11254d47861cfbda255bd76c86c22cc959c79041
patch.trydiff: add a docstring

It took me a bit to figure out what this function actually does.
Matt Mackall - March 18, 2015, 9:51 p.m.
On Tue, 2015-03-17 at 15:57 -0700, Siddharth Agarwal wrote:
> # HG changeset patch
> # User Siddharth Agarwal <sid0@fb.com>
> # Date 1426622775 25200
> #      Tue Mar 17 13:06:15 2015 -0700
> # Node ID 194f4ddf99b761fbb2bc883cc93629ecc09c0c84
> # Parent  11254d47861cfbda255bd76c86c22cc959c79041
> patch.trydiff: add a docstring

I've queued these first three, thanks.

Patch

diff --git a/mercurial/patch.py b/mercurial/patch.py
--- a/mercurial/patch.py
+++ b/mercurial/patch.py
@@ -2206,6 +2206,12 @@ 
 
 def trydiff(repo, revs, ctx1, ctx2, modified, added, removed,
             copy, getfilectx, opts, losedatafn, prefix):
+    '''given input data, generate a diff and yield it in blocks
+
+    If generating a diff would lose data like flags or binary data and
+    losedatafn is not None, it will be called.
+
+    prefix is added to every path in the diff output.'''
 
     def gitindex(text):
         if not text: