diff --git a/hgext/largefiles/lfcommands.py b/hgext/largefiles/lfcommands.py --- a/hgext/largefiles/lfcommands.py +++ b/hgext/largefiles/lfcommands.py @@ -383,6 +383,13 @@ def verifylfiles(ui, repo, all=False, co store = basestore._openstore(repo) return store.verify(revs, contents=contents) +def debugdirstate(ui, repo): + '''Show basic information for the largefiles dirstate''' + lfdirstate = lfutil.openlfdirstate(ui, repo) + for file_, ent in sorted(lfdirstate._map.iteritems()): + mode = '%3o' % (ent[1] & 0777 & ~util.umask) + ui.write("%c %s %10d %s\n" % (ent[0], mode, ent[2], file_)) + def cachelfiles(ui, repo, node, filelist=None): '''cachelfiles ensures that all largefiles needed by the specified revision are present in the repository's largefile cache. diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py --- a/hgext/largefiles/overrides.py +++ b/hgext/largefiles/overrides.py @@ -256,6 +256,13 @@ def overrideverify(orig, ui, repo, *pats result = result or lfcommands.verifylfiles(ui, repo, all, contents) return result +def overridedebugstate(orig, ui, repo, *pats, **opts): + large = opts.pop('large', False) + if large: + lfcommands.debugdirstate(ui, repo) + else: + orig(ui, repo, *pats, **opts) + # Override needs to refresh standins so that update's normal merge # will go through properly. Then the other update hook (overriding repo.update) # will get the new files. Filemerge is also overridden so that the merge diff --git a/hgext/largefiles/uisetup.py b/hgext/largefiles/uisetup.py --- a/hgext/largefiles/uisetup.py +++ b/hgext/largefiles/uisetup.py @@ -59,6 +59,11 @@ def uisetup(ui): _('verify largefile contents not just existence'))] entry[1].extend(verifyopt) + entry = extensions.wrapcommand(commands.table, 'debugstate', + overrides.overridedebugstate) + debugstateopt = [('', 'large', None, _('display largefiles dirstate'))] + entry[1].extend(debugstateopt) + entry = extensions.wrapcommand(commands.table, 'outgoing', overrides.overrideoutgoing) outgoingopt = [('', 'large', None, _('display outgoing largefiles'))] diff --git a/tests/test-largefiles.t b/tests/test-largefiles.t --- a/tests/test-largefiles.t +++ b/tests/test-largefiles.t @@ -17,8 +17,8 @@ > EOF Create the repo with a couple of revisions of both large and normal -files, testing that status correctly shows largefiles and that summary output -is correct. +files. +Test status and dirstate of largefiles and that summary output is correct. $ hg init a $ cd a @@ -35,6 +35,17 @@ is correct. A normal1 A sub/large2 A sub/normal2 + $ touch large1 sub/large2 + $ sleep 1 + $ hg st + $ hg debugstate --nodates + n 644 41 .hglf/large1 + n 644 41 .hglf/sub/large2 + n 644 8 normal1 + n 644 8 sub/normal2 + $ hg debugstate --large + n 644 7 large1 + n 644 7 sub/large2 $ echo normal11 > normal1 $ echo normal22 > sub/normal2 $ echo large11 > large1