##// END OF EJS Templates
merge with stable
Augie Fackler -
r34122:07f09995 merge default
parent child Browse files
Show More
@@ -504,8 +504,11 b' class queue(object):'
504 self.guardsdirty = False
504 self.guardsdirty = False
505 self.activeguards = None
505 self.activeguards = None
506
506
507 def diffopts(self, opts=None, patchfn=None):
507 def diffopts(self, opts=None, patchfn=None, plain=False):
508 diffopts = patchmod.diffopts(self.ui, opts)
508 """Return diff options tweaked for this mq use, possibly upgrading to
509 git format, and possibly plain and without lossy options."""
510 diffopts = patchmod.difffeatureopts(self.ui, opts,
511 git=True, whitespace=not plain, formatchanging=not plain)
509 if self.gitmode == 'auto':
512 if self.gitmode == 'auto':
510 diffopts.upgrade = True
513 diffopts.upgrade = True
511 elif self.gitmode == 'keep':
514 elif self.gitmode == 'keep':
@@ -1178,7 +1181,7 b' class queue(object):'
1178 date = opts.get('date')
1181 date = opts.get('date')
1179 if date:
1182 if date:
1180 date = util.parsedate(date)
1183 date = util.parsedate(date)
1181 diffopts = self.diffopts({'git': opts.get('git')})
1184 diffopts = self.diffopts({'git': opts.get('git')}, plain=True)
1182 if opts.get('checkname', True):
1185 if opts.get('checkname', True):
1183 self.checkpatchname(patchfn)
1186 self.checkpatchname(patchfn)
1184 inclsubs = checksubstate(repo)
1187 inclsubs = checksubstate(repo)
@@ -1643,7 +1646,8 b' class queue(object):'
1643 substatestate = repo.dirstate['.hgsubstate']
1646 substatestate = repo.dirstate['.hgsubstate']
1644
1647
1645 ph = patchheader(self.join(patchfn), self.plainmode)
1648 ph = patchheader(self.join(patchfn), self.plainmode)
1646 diffopts = self.diffopts({'git': opts.get('git')}, patchfn)
1649 diffopts = self.diffopts({'git': opts.get('git')}, patchfn,
1650 plain=True)
1647 if newuser:
1651 if newuser:
1648 ph.setuser(newuser)
1652 ph.setuser(newuser)
1649 if newdate:
1653 if newdate:
@@ -2085,10 +2085,10 b' def debugssl(ui, repo, source=None, **op'
2085 'Windows'))
2085 'Windows'))
2086
2086
2087 if not source:
2087 if not source:
2088 if not repo:
2089 raise error.Abort(_("there is no Mercurial repository here, and no "
2090 "server specified"))
2088 source = "default"
2091 source = "default"
2089 elif not repo:
2090 raise error.Abort(_("there is no Mercurial repository here, and no "
2091 "server specified"))
2092
2092
2093 source, branches = hg.parseurl(ui.expandpath(source))
2093 source, branches = hg.parseurl(ui.expandpath(source))
2094 url = util.url(source)
2094 url = util.url(source)
@@ -208,5 +208,62 b' git=no: regular patch after qrefresh wit'
208 @@ -0,0 +1,1 @@
208 @@ -0,0 +1,1 @@
209 +a
209 +a
210
210
211 Test how [diff] configuration influence and cause invalid or lossy patches:
212
213 $ cat <<EOF >> .hg/hgrc
214 > [mq]
215 > git = AUTO
216 > [diff]
217 > nobinary = True
218 > noprefix = True
219 > showfunc = True
220 > ignorews = True
221 > ignorewsamount = True
222 > ignoreblanklines = True
223 > unified = 1
224 > EOF
225
226 $ echo ' a' > a
227 $ hg qnew prepare -d '0 0'
228 $ echo ' a' > a
229 $ printf '\0' > b
230 $ echo >> c
231 $ hg qnew diff -d '0 0'
232
233 $ cat .hg/patches/prepare
234 # HG changeset patch
235 # Date 0 0
236 # Parent cf0bfe72686a47d8d7d7b4529a3adb8b0b449a9f
237
238 diff -r cf0bfe72686a -r fb9c4422b0f3 a
239 --- a/a
240 +++ b/a
241 @@ -1,1 +1,1 @@
242 -a
243 + a
244 $ cat .hg/patches/diff
245 # HG changeset patch
246 # Date 0 0
247 # Parent fb9c4422b0f37dd576522dd9a3f99b825c177efe
248
249 diff --git a/a b/a
250 --- a/a
251 +++ b/a
252 @@ -1,1 +1,1 @@
253 - a
254 + a
255 diff --git a/b b/b
256 index 78981922613b2afb6025042ff6bd878ac1994e85..f76dd238ade08917e6712764a16a22005a50573d
257 GIT binary patch
258 literal 1
259 Ic${MZ000310RR91
260
261 diff --git a/c b/c
262 --- a/c
263 +++ b/c
264 @@ -1,1 +1,2 @@
265 a
266 +
267
211 $ cd ..
268 $ cd ..
212
269
General Comments 0
You need to be logged in to leave comments. Login now