Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How can I cherry pick the files I want to shelve

Bruce_Holm January 18, 2018

I have 5 modified files. Two are modified to facilitate getting my local dev server going instead of for staging or production servers. Those I frequently need to shelve and unshelve as part of doing a Pull/Update. The other three are actual changes I may commit someday. 

How can I shelve the two files to one shelf and the other 3 files to another shelf and access either later using a name I choose?

Is this possible? If so, how?

1 answer

0 votes
Manju
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 19, 2018

You should make use of Patch for the 2 files that you'll use often and doesn't need to be checked in. 

Once you have a patch, you can apply it as many number of time as possible in any branch. 

Shelves may not work the way you want on other branches.

Bruce_Holm January 21, 2018

This sounded like a good idea but when I created a patch file of the two files involved, discarded the changes to both files, then applied the patch file, both file contents were completely replaced instead of just the diff changes shown in the patch. Is this normal for patch files to replace the contents with modified content such that the top half the diff view shows pink "-" lines and the bottom half shows green "+" lines? When I complete a shelve operation in TortoiseHg it simply shows only the modified lines in pink/green, not the whole file content. One of my two files has 2 lines changed, the begin comment and end comment symbols (commenting a 10 line block of code.) Yet the patch shows it needed to replace all contents. 

Manju
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 22, 2018

Patches are ideally nothing but diffs. Have you tried ignore whitespace for the diff that you are seeing? 

Bruce_Holm January 23, 2018

Yes, that changed the diff view to show only the lines that changed! Thanks!

Why is there a difference? When I view the same diff but using an external Beyond Compare (which will show any whitespace diffs) it only sees the few lines that changed, not the whole file. It seems the default setting of Show whitespace option is not really showing correctly?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events