view tests/test-diff-copy-depth.t @ 34094:5d45a997d11d

rebase: remove complex unhiding code This is similar to Martin von Zweigbergk's previous patch [1]. Previous patches are adding more `.unfiltered()` to the rebase code. So I wonder: are we playing whack-a-mole regarding on `unfiltered()` in rebase? Thinking about it, I believe most of the rebase code *should* just use an unfiltered repo. The only exception is before we figuring out a `rebasestate`. This patch makes it so. See added comment in code for why that's more reasonable. This would make the code base cleaner (not mangling the `repo` object), faster (no need to invalidate caches), simpler (less LOC), less error-prone (no need to think about what to unhide, ex. should we unhide wdir p2? how about destinations?), and future proof (other code may change visibility in an unexpected way, ex. directaccess may make the destination only visible when it's in "--dest" revset tree). [1]: https://www.mercurial-scm.org/pipermail/mercurial-devel/2017-March/094277.html Differential Revision: https://phab.mercurial-scm.org/D644
author Jun Wu <quark@fb.com>
date Wed, 06 Sep 2017 16:13:04 -0700
parents bca69641de61
children
line wrap: on
line source

  $ for i in aaa zzz; do
  >     hg init t
  >     cd t
  > 
  >     echo
  >     echo "-- With $i"
  > 
  >     touch file
  >     hg add file
  >     hg ci -m "Add"
  > 
  >     hg cp file $i
  >     hg ci -m "a -> $i"
  > 
  >     hg cp $i other-file
  >     echo "different" >> $i
  >     hg ci -m "$i -> other-file"
  > 
  >     hg cp other-file somename
  > 
  >     echo "Status":
  >     hg st -C
  >     echo
  >     echo "Diff:"
  >     hg diff -g
  > 
  >     cd ..
  >     rm -rf t
  > done
  
  -- With aaa
  Status:
  A somename
    other-file
  
  Diff:
  diff --git a/other-file b/somename
  copy from other-file
  copy to somename
  
  -- With zzz
  Status:
  A somename
    other-file
  
  Diff:
  diff --git a/other-file b/somename
  copy from other-file
  copy to somename