Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

tool to inspect mercurial's internal files

Git has the cat-file command to inspect internal files, e.g. git cat-file blob 557db03 will show the contents of the object whose hash starts with 557db03.

Are there similar tools for mercurial that allow me to look at all the different data files that merfcurial uses internally?

like image 405
daniel kullmann Avatar asked Nov 24 '11 07:11

daniel kullmann


People also ask

How to remove files from hg?

Once you decide that a file no longer belongs in your repository, use the hg remove command. This deletes the file, and tells Mercurial to stop tracking it (which will occur at the next commit). A removed file is represented in the output of hg status with a “ R ”.

How do I revert a file in Mercurial?

To revert a file to a specific changeset, use hg revert -r CHANGESET FILENAME . This will revert the file without committing it.

What is hg status?

hg status shows the status of a repository. Files are stored in a project's working directory (which users see), and the local repository (where committed snapshots are permanently recorded). hg add tells Mercurial to track files. hg commit creates a snapshot of the changes to 1 or more files in the local repository.


2 Answers

Try hg --debug help and you can see the list of all the debug commands:

 debugancestor:
      find the ancestor revision of two revisions in a given index
 debugbuilddag:
      builds a repo with a given DAG from scratch in the current empty repo
 debugbundle:
      lists the contents of a bundle
 debugcheckstate:
      validate the correctness of the current dirstate
 debugcommands:
      list all available commands and options
 debugcomplete:
      returns the completion list associated with the given command
 debugdag:
      format the changelog or an index DAG as a concise textual description
 debugdata:
      dump the contents of a data file revision
 debugdate:
      parse and display a date
 debugdiscovery:
      runs the changeset discovery protocol in isolation
 debugfileset:
      parse and apply a fileset specification
 debugfsinfo:
      show information detected about current filesystem
 debuggetbundle:
      retrieves a bundle from a repo
 debugignore:
      display the combined ignore pattern
 debugindex:
      dump the contents of an index file
 debugindexdot:
      dump an index DAG as a graphviz dot file
 debuginstall:
      test Mercurial installation
 debugknown:
      test whether node ids are known to a repo
 debugpushkey:
      access the pushkey key/value protocol
 debugrebuildstate:
      rebuild the dirstate as it would look like for the given revision
 debugrename:
      dump rename information
 debugrevlog:
      show data and statistics about a revlog
 debugrevspec:
      parse and apply a revision specification
 debugsetparents:
      manually set the parents of the current working directory
 debugstate:
      show the contents of the current dirstate
 debugsub:
      (no help text available)
 debugwalk:
      show how files match on given patterns
 debugwireargs:
      (no help text available)

There are a lot of them, and they pretty much expose everything.

like image 106
Ry4an Brase Avatar answered Nov 15 '22 11:11

Ry4an Brase


The closest commands would be:

hg cat -r rev aFile

hg cat: Print the specified files as they were at the given revision

This is not completely the same than git cat-file though, as the latter can also list SHA1, type, and size for a list of objects.

In that second case, hg manifest might be more appropriate.

like image 22
VonC Avatar answered Nov 15 '22 11:11

VonC