How to list all files in a repository in Mercurial (hg)?

后端 未结 5 695
小蘑菇
小蘑菇 2021-01-30 19:19

Is there a command in mercurial that will list all files currently under source control?

I can do a dir /s to list all files in my folder and subfolders,

5条回答
  •  暖寄归人
    2021-01-30 19:59

    You might also check out the hg locate command. I use it, along with the -I option when I want to limit the files to a certain directory.

    To list all files in your repository:

    hg locate
    

    From the repository ("root") directory:

    hg locate -I dir/sub_dir/dir_of_interest
    

    The path passed to -I needs to change depending on the directory in which you run the command. If you run the command from the dir directory in the example above, you'd need to modify your argument to locate:

    hg locate -I sub_dir/dir_of_interest
    

    The list of output files will remain the same, showing each file's full path in the repository.

    Try hg help -v locate for more info.

提交回复
热议问题