In Mercurial (hg), how do you see a list of files that will be pushed if an “hg push” is issued?

前端 未结 5 1897
后悔当初
后悔当初 2020-12-14 08:06

We can see all the changesets and the files involved using

hg outgoing -v

but the filenames are all scattered in the list of changesets.

5条回答
  •  旧时难觅i
    2020-12-14 09:07

    I usually use

    hg outgoing -v | grep files
    

    It makes the listing shorter, but doesnt sort. But thus far I havent been in a situation where I want to push so much (and at the same time check the files) that its been a problem.

    [Edit] To do what you want:

    • Use cut to remove the files: part
    • For changesets with more than one touched file, use tr to put them on separate lines
    • Finally sort the resulting output with sort

    Like so:

    hg outgoing -v |grep files: |cut -c 14- |tr ' ' '\n' |sort -u
    

    You can put this in ~/outgoingfiles.sh or something to have it nice and ready.

提交回复
热议问题