# HG changeset patch # User Yuya Nishihara # Date 1510399286 -32400 # Node ID 7a84a8656679e5c10d3c80b7aa51710c515dbea3 # Parent 6987d6cd420c35a9dde0642cb6cd4008e59afa70 client: do not append an option to a list of arguments It wouldn't work if args are terminated with "--". diff -r 6987d6cd420c -r 7a84a8656679 hglib/client.py --- a/hglib/client.py Mon Aug 21 17:13:37 2017 +0200 +++ b/hglib/client.py Sat Nov 11 20:21:26 2017 +0900 @@ -852,9 +852,8 @@ args = cmdbuilder(b('grep'), all=all, a=text, f=follow, i=ignorecase, l=fileswithmatches, n=line, u=user, d=date, - I=include, X=exclude, hidden=self.hidden, + I=include, X=exclude, hidden=self.hidden, print0=True, *[pattern] + files) - args.append(b('-0')) def eh(ret, out, err): if ret != 1: @@ -1136,13 +1135,14 @@ """ # we can't really use --preview since merge doesn't support --template - args = cmdbuilder(b('merge'), r=rev, f=force, t=tool) + args = cmdbuilder(b('merge'), r=rev, f=force, t=tool, + y=(cb is merge.handlers.noninteractive)) prompt = None if cb is merge.handlers.abort: prompt = cb elif cb is merge.handlers.noninteractive: - args.append(b('-y')) + pass else: prompt = lambda size, output: cb(output) + b('\n') @@ -1473,9 +1473,7 @@ args = cmdbuilder(b('status'), rev=rev, change=change, A=all, m=modified, a=added, r=removed, d=deleted, c=clean, u=unknown, i=ignored, C=copies, S=subrepos, I=include, - X=exclude, hidden=self.hidden) - - args.append(b('-0')) + X=exclude, hidden=self.hidden, print0=True) out = self.rawcommand(args) l = []