Show More
@@ -1,7 +1,7 b'' | |||||
1 | Valid URLs are of the form:: |
|
1 | Valid URLs are of the form:: | |
2 |
|
2 | |||
3 | local/filesystem/path[#revision] |
|
3 | local/filesystem/path[#revision] | |
4 |
file://local |
|
4 | file://local/filesystem/path[#revision] | |
5 | http://[user[:pass]@]host[:port]/[path][#revision] |
|
5 | http://[user[:pass]@]host[:port]/[path][#revision] | |
6 | https://[user[:pass]@]host[:port]/[path][#revision] |
|
6 | https://[user[:pass]@]host[:port]/[path][#revision] | |
7 | ssh://[user@]host[:port]/[path][#revision] |
|
7 | ssh://[user@]host[:port]/[path][#revision] |
@@ -434,7 +434,10 b' def follow(repo, subset, x):' | |||||
434 | p = repo['.'].rev() |
|
434 | p = repo['.'].rev() | |
435 | if l: |
|
435 | if l: | |
436 | x = getstring(l[0], _("follow expected a filename")) |
|
436 | x = getstring(l[0], _("follow expected a filename")) | |
437 | s = set(ctx.rev() for ctx in repo['.'][x].ancestors()) |
|
437 | if x in repo['.']: | |
|
438 | s = set(ctx.rev() for ctx in repo['.'][x].ancestors()) | |||
|
439 | else: | |||
|
440 | return [] | |||
438 | else: |
|
441 | else: | |
439 | s = set(repo.changelog.ancestors(p)) |
|
442 | s = set(repo.changelog.ancestors(p)) | |
440 |
|
443 |
@@ -823,6 +823,12 b' class gitsubrepo(abstractsubrepo):' | |||||
823 | def _gitisbare(self): |
|
823 | def _gitisbare(self): | |
824 | return self._gitcommand(['config', '--bool', 'core.bare']) == 'true' |
|
824 | return self._gitcommand(['config', '--bool', 'core.bare']) == 'true' | |
825 |
|
825 | |||
|
826 | def _gitupdatestat(self): | |||
|
827 | """This must be run before git diff-index. | |||
|
828 | diff-index only looks at changes to file stat; | |||
|
829 | this command looks at file contents and updates the stat.""" | |||
|
830 | self._gitcommand(['update-index', '-q', '--refresh']) | |||
|
831 | ||||
826 | def _gitbranchmap(self): |
|
832 | def _gitbranchmap(self): | |
827 | '''returns 2 things: |
|
833 | '''returns 2 things: | |
828 | a map from git branch to revision |
|
834 | a map from git branch to revision | |
@@ -892,6 +898,7 b' class gitsubrepo(abstractsubrepo):' | |||||
892 | # different version checked out |
|
898 | # different version checked out | |
893 | return True |
|
899 | return True | |
894 | # check for staged changes or modified files; ignore untracked files |
|
900 | # check for staged changes or modified files; ignore untracked files | |
|
901 | self._gitupdatestat() | |||
895 | out, code = self._gitdir(['diff-index', '--quiet', 'HEAD']) |
|
902 | out, code = self._gitdir(['diff-index', '--quiet', 'HEAD']) | |
896 | return code == 1 |
|
903 | return code == 1 | |
897 |
|
904 | |||
@@ -999,6 +1006,7 b' class gitsubrepo(abstractsubrepo):' | |||||
999 | source, revision, kind = state |
|
1006 | source, revision, kind = state | |
1000 | self._fetch(source, revision) |
|
1007 | self._fetch(source, revision) | |
1001 | base = self._gitcommand(['merge-base', revision, self._state[1]]) |
|
1008 | base = self._gitcommand(['merge-base', revision, self._state[1]]) | |
|
1009 | self._gitupdatestat() | |||
1002 | out, code = self._gitdir(['diff-index', '--quiet', 'HEAD']) |
|
1010 | out, code = self._gitdir(['diff-index', '--quiet', 'HEAD']) | |
1003 |
|
1011 | |||
1004 | def mergefunc(): |
|
1012 | def mergefunc(): | |
@@ -1106,6 +1114,7 b' class gitsubrepo(abstractsubrepo):' | |||||
1106 | # if the repo is missing, return no results |
|
1114 | # if the repo is missing, return no results | |
1107 | return [], [], [], [], [], [], [] |
|
1115 | return [], [], [], [], [], [], [] | |
1108 | modified, added, removed = [], [], [] |
|
1116 | modified, added, removed = [], [], [] | |
|
1117 | self._gitupdatestat() | |||
1109 | if rev2: |
|
1118 | if rev2: | |
1110 | command = ['diff-tree', rev1, rev2] |
|
1119 | command = ['diff-tree', rev1, rev2] | |
1111 | else: |
|
1120 | else: |
@@ -361,6 +361,15 b" Don't crash if the .hgsubstate entry is " | |||||
361 | $ hg update -qC nosubstate |
|
361 | $ hg update -qC nosubstate | |
362 | $ ls s |
|
362 | $ ls s | |
363 |
|
363 | |||
|
364 | issue3109: false positives in git diff-index | |||
|
365 | ||||
|
366 | $ hg update -q | |||
|
367 | $ touch -t 200001010000 s/g | |||
|
368 | $ hg status --subrepos | |||
|
369 | $ touch -t 200001010000 s/g | |||
|
370 | $ hg sum | grep commit | |||
|
371 | commit: (clean) | |||
|
372 | ||||
364 | Check hg update --clean |
|
373 | Check hg update --clean | |
365 | $ cd $TESTTMP/ta |
|
374 | $ cd $TESTTMP/ta | |
366 | $ echo > s/g |
|
375 | $ echo > s/g |
General Comments 0
You need to be logged in to leave comments.
Login now