##// END OF EJS Templates
patch: ensure valid git diffs if source/destination file is missing (issue4046)...
Johan Bjork -
r19973:1184edae stable
parent child Browse files
Show More
@@ -1703,7 +1703,7 b' def trydiff(repo, revs, ctx1, ctx2, modi'
1703 tn = getfilectx(f, ctx2).data()
1703 tn = getfilectx(f, ctx2).data()
1704 a, b = f, f
1704 a, b = f, f
1705 if opts.git or losedatafn:
1705 if opts.git or losedatafn:
1706 if f in added:
1706 if f in added or (f in modified and to is None):
1707 mode = gitmode[ctx2.flags(f)]
1707 mode = gitmode[ctx2.flags(f)]
1708 if f in copy or f in copyto:
1708 if f in copy or f in copyto:
1709 if opts.git:
1709 if opts.git:
@@ -1739,7 +1739,7 b' def trydiff(repo, revs, ctx1, ctx2, modi'
1739 if not opts.git and not tn:
1739 if not opts.git and not tn:
1740 # regular diffs cannot represent new empty file
1740 # regular diffs cannot represent new empty file
1741 losedatafn(f)
1741 losedatafn(f)
1742 elif f in removed:
1742 elif f in removed or (f in modified and tn is None):
1743 if opts.git:
1743 if opts.git:
1744 # have we already reported a copy above?
1744 # have we already reported a copy above?
1745 if ((f in copy and copy[f] in added
1745 if ((f in copy and copy[f] in added
@@ -360,3 +360,23 b' There should be a trailing TAB if there '
360 +foo
360 +foo
361 $ hg ci -m 'add filename with spaces'
361 $ hg ci -m 'add filename with spaces'
362
362
363 Additions should be properly marked even in the middle of a merge
364
365 $ hg up -r -2
366 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
367 $ echo "New File" >> inmerge
368 $ hg add inmerge
369 $ hg ci -m "file in merge"
370 created new head
371 $ hg up 23
372 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
373 $ hg merge
374 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
375 (branch merge, don't forget to commit)
376 $ hg diff -g
377 diff --git a/inmerge b/inmerge
378 new file mode 100644
379 --- /dev/null
380 +++ b/inmerge
381 @@ -0,0 +1,1 @@
382 +New File
@@ -228,6 +228,7 b' ensure that we have a merge with unresol'
228 +a
228 +a
229 +>>>>>>> other
229 +>>>>>>> other
230 diff --git a/b.rename/b b/b.rename/b
230 diff --git a/b.rename/b b/b.rename/b
231 new file mode 100644
231 --- /dev/null
232 --- /dev/null
232 +++ b/b.rename/b
233 +++ b/b.rename/b
233 @@ -0,0 +1,1 @@
234 @@ -0,0 +1,1 @@
@@ -239,6 +240,7 b' ensure that we have a merge with unresol'
239 @@ -1,1 +0,0 @@
240 @@ -1,1 +0,0 @@
240 -b
241 -b
241 diff --git a/c.copy b/c.copy
242 diff --git a/c.copy b/c.copy
243 new file mode 100644
242 --- /dev/null
244 --- /dev/null
243 +++ b/c.copy
245 +++ b/c.copy
244 @@ -0,0 +1,1 @@
246 @@ -0,0 +1,1 @@
General Comments 0
You need to be logged in to leave comments. Login now