DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Mercurial (002cae39b87d)

VCS Links

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177
  $ . $TESTDIR/hgext/overlay/tests/helpers.sh

  $ hg init source
  $ cd source
  $ echo 0 > foo
  $ hg -q commit -A -m 'source commit 0'
  $ echo 1 > foo
  $ hg commit -m 'source commit 1'
  $ hg serve -d --pid-file hg.pid -p $HGPORT
  $ cat hg.pid >> $DAEMON_PIDS
  $ cd ..

  $ hg init dest
  $ cd dest
  $ touch root
  $ hg -q commit -A -m 'dest commit 0'

  $ hg overlay http://localhost:$HGPORT --into subdir
  pulling http://localhost:$HGPORT into $TESTTMP/dest/.hg/localhost~3a* (glob)
  requesting all changes
  adding changesets
  adding manifests
  adding file changes
  added 2 changesets with 2 changes to 1 files
  new changesets 00f6e41c0e85:c71ec8379b05 (?)
  00f6e41c0e85 -> 680a5f65e0c3: source commit 0
  c71ec8379b05 -> 81f80944e32d: source commit 1

Incremental overlay will no-op since no new changesets

  $ hg overlay http://localhost:$HGPORT --into subdir
  c71ec8379b05 already processed as 81f80944e32d; skipping 2/2 revisions
  no source revisions left to process

New changeset in source should get applied as expected

  $ cd ../source
  $ echo 2 > foo
  $ hg commit -m 'source commit 2'
  $ cd ../dest
  $ hg overlay http://localhost:$HGPORT --into subdir
  pulling http://localhost:$HGPORT into $TESTTMP/dest/.hg/localhost~3a* (glob)
  searching for changes
  adding changesets
  adding manifests
  adding file changes
  added 1 changesets with 1 changes to 1 files
  new changesets 60f2998d907d (?)
  c71ec8379b05 already processed as 81f80944e32d; skipping 2/3 revisions
  60f2998d907d -> 50fab12f8664: source commit 2

  $ hg log -G -T '{node|short} {desc}'
  o  50fab12f8664 source commit 2
  |
  o  81f80944e32d source commit 1
  |
  o  680a5f65e0c3 source commit 0
  |
  @  cb699e5348c1 dest commit 0
  

New changeset in source and dest results in being applied on latest in dest

  $ cd ../source
  $ echo 3 > foo
  $ hg commit -m 'source commit 3'
  $ cd ../dest

  $ hg -q up tip
  $ echo 'source 2' > root
  $ hg commit -m 'dest commit 1'

  $ hg overlay http://localhost:$HGPORT --into subdir
  pulling http://localhost:$HGPORT into $TESTTMP/dest/.hg/localhost~3a* (glob)
  searching for changes
  adding changesets
  adding manifests
  adding file changes
  added 1 changesets with 1 changes to 1 files
  new changesets 2d54a6016dfe (?)
  60f2998d907d already processed as 50fab12f8664; skipping 3/4 revisions
  2d54a6016dfe -> 3b62843da7a4: source commit 3

  $ hg log -G -T '{node|short} {desc}'
  o  3b62843da7a4 source commit 3
  |
  @  504ce2b98c14 dest commit 1
  |
  o  50fab12f8664 source commit 2
  |
  o  81f80944e32d source commit 1
  |
  o  680a5f65e0c3 source commit 0
  |
  o  cb699e5348c1 dest commit 0
  

Overlaying onto a head without all changesets will pick up where it left off

  $ hg -q up 81f80944e32d
  $ echo 'head 1' > root
  $ hg commit -m 'head 1'
  created new head
  $ hg overlay http://localhost:$HGPORT --into subdir
  c71ec8379b05 already processed as 81f80944e32d; skipping 2/4 revisions
  60f2998d907d -> 13ddb87af500: source commit 2
  2d54a6016dfe -> b06ac9515e0a: source commit 3

  $ hg log -G -T '{node|short} {desc}'
  o  b06ac9515e0a source commit 3
  |
  o  13ddb87af500 source commit 2
  |
  @  9af62c37d9de head 1
  |
  | o  3b62843da7a4 source commit 3
  | |
  | o  504ce2b98c14 dest commit 1
  | |
  | o  50fab12f8664 source commit 2
  |/
  o  81f80944e32d source commit 1
  |
  o  680a5f65e0c3 source commit 0
  |
  o  cb699e5348c1 dest commit 0
  

Source rev that has already been overlayed will fail

  $ hg overlay http://localhost:$HGPORT 'c71ec8379b05::' --into subdir
  2d54a6016dfe already processed as b06ac9515e0a; skipping 3/3 revisions
  no source revisions left to process

Source rev starting at next changeset will work

  $ echo 'head 1 commit 2' > root
  $ hg commit -m 'head 1 commit 2'
  created new head
  $ hg overlay http://localhost:$HGPORT '60f2998d907d::' --into subdir
  60f2998d907d -> 0a78f301953e: source commit 2
  2d54a6016dfe -> 4c9b5c9fec78: source commit 3

  $ hg log -G -T '{node|short} {desc}'
  o  4c9b5c9fec78 source commit 3
  |
  o  0a78f301953e source commit 2
  |
  @  c99f42f18be8 head 1 commit 2
  |
  | o  b06ac9515e0a source commit 3
  | |
  | o  13ddb87af500 source commit 2
  |/
  o  9af62c37d9de head 1
  |
  | o  3b62843da7a4 source commit 3
  | |
  | o  504ce2b98c14 dest commit 1
  | |
  | o  50fab12f8664 source commit 2
  |/
  o  81f80944e32d source commit 1
  |
  o  680a5f65e0c3 source commit 0
  |
  o  cb699e5348c1 dest commit 0
  

Selecting a source changeset that is missing parents in dest will fail

  $ echo 'head 1 commit 3' > root
  $ hg commit -m 'head 1 commit 3'
  created new head
  $ hg overlay http://localhost:$HGPORT '2d54a6016dfe::' --into subdir
  abort: first source changeset (2d54a6016dfe) is not a child of last overlayed changeset (c71ec8379b05)
  [255]