Mercurial is the best way to get a summary of changes to incoming files

I am trying to work if there is a way to get the same information as the hg status for incoming. (Using hg version 1.9.2)

So, if you select a repo, you can get a summary of all the changes:

hg pull
hg status --rev .:default

However, with the incoming before pulling, the best available is:

hg incoming --stat

This is normal for displaying files that have been modified. But it does not provide a general summary of all sets of changes.

Now I can get close with bash to summarize all the files:

hg in --rev default --template '< {desc|tabindent}\n' -q | sed 's%\t%<   %'
filechanges=`hg in --rev default --template '{files} ' -q`
echo ${filechanges} | xargs -n1 | sort -u | sed -e 's%^%. %'

Now I can show "add, del, modify" using the style I created from the standard files ~ / hgtemplates / map-cmdline.files:

# specify a changeset
changeset_verbose = 'changeset: {node} {rev} {branch}\ndescription:\n{desc|tabindent}\nFiles:\n{file_mods}{file_adds}{file_dels}{file_copies_switch}\n'
changeset = 'desc: {desc|tabindent}\nFiles:\n{file_mods}{file_adds}{file_dels}{file_copies_switch}\n'
changeset_quiet = '{file_mods}{file_adds}{file_dels}{file_copies_switch}\n'

# Using hg status prefixes

# Modified M prefix
start_file_mods = ''
file_mod = 'M {file_mod}\n'
end_file_mods = ''

# Added A prefix
start_file_adds = ''
file_add = 'A {file_add}\n'
end_file_adds = ''

# Deleted ! prefix
start_file_dels = ''
file_del = '! {file_del}\n'
end_file_dels = ''

# Copies C prefix ??????
start_file_copies = 'copies:     '
file_copy = 'C {name} ({source})\n'
end_file_copies = ''

Then use it:

hg in --style ~/hgtemplates/map-cmdline.files -q

But then I would have to use a more complex merge script, maybe perl name-based hashes.

, ?

?

+4
1

-, , hg incoming hg pull. ( ), , .

, , --bundle pull , .

, :

hg incoming --bundle .hg/changes.hg
hg status -R .hg/changes.hg --rev 'bundle()'

, , , hg -R .hg/changes.hg. bundle() . , , --rev , --change, .

, , , :

hg pull .hg/changes.hg

, , , .hg/changes.hg.

+5

Source: https://habr.com/ru/post/1623059/


All Articles