• AVR Freaks

Hot!Possible Rapid Archive Method while developing in MPLABx

Author
CNS
New Member
  • Total Posts : 20
  • Reward points : 0
  • Status: offline
2019/02/17 21:43:31 (permalink)
5 (1)

Possible Rapid Archive Method while developing in MPLABx

Does anybody see a problem with this new custom backup (archive) method.  In the past I had been copying the whole project directory that lived directly under my MPLABProjects folder. Recently to organize my projects better, I had made an additional sub project folder "HVAC".   I am basically now using the project MyHVAC_Ver01 for ongoing development. Every so many hours(or minutes) I simply copy the project back into the HVAC folder (where it becomes folder (1), (2), etc).  If something blows-up in my code development, I can revert back to a the most recent ....copy(x).  I am using the SOURCE | FORMAT command to recursively format to allow a clean compile in the newly copied archive folder.  I'm not sure if the source-format is even meant to be used this way.....So, my question, is please review the attached and give advice if this is an acceptable way to fix the file path issues that is a result of copying the whole project.

Attachment(s)

Attachments are not available: Download requirements not met
#1

16 Replies Related Threads

    Mysil
    Super Member
    • Total Posts : 3324
    • Reward points : 0
    • Joined: 2012/07/01 04:19:50
    • Location: Norway
    • Status: offline
    Re: Possible Rapid Archive Method while developing in MPLABx 2019/02/18 00:26:10 (permalink)
    +3 (3)
    Hi,
    If it works for you, and keep you safe, then it is good.
     
    In order to be really safe against a serious hardware crash, or loss of computer, there is also the idea to copy to a external device. Something like external USB disk, SD-card or similar, and store in a different place. 
     
    Copying all files in project directory and below, will copy a lot of files that are not really needed to restore the project.
    There is a Package tool in MPLAB X :
    In Project view, the upper left panel, point to root of project tree, the PDIP icon,
    click the right mouse button, in the popup menu is 'Package' item.
    It will create a .zip file, with exactly those files needed to restore the project.
     
    Storing all files together, every time, may be a little cumbersome if you want to trace back into the history of a file or project.
    There are several source code archive / version control systems around,
    with storage in your local computer, or in a network.
    See Wikipedia: https://en.wikipedia.org/wiki/Version_control
    'Subversion' may be one of the most known among hobbyists and open source community. 
    There is a list on Wikipedia.
    I use 'Perforce', now 'Helix Core', mainly because I was familiar with it from my work. It is free for up to 5 users.
     
    Then there are general Backup and Synchronisaton programs
    that may run when you want, at scheduled times,  or continually.
    I use GoodSync, but there are several others.
    Some external diskdrive products come with such software included.
     
        Mysil
    #2
    CNS
    New Member
    • Total Posts : 20
    • Reward points : 0
    • Status: offline
    Re: Possible Rapid Archive Method while developing in MPLABx 2019/02/18 10:35:51 (permalink)
    0
    Mysil, thank you.  I had tried the package command some time back but I had experienced a problem and thus had resulted to copying the whole file structure because I needed a solid backup method. I just used it and it now works.
     
    I will also research a version control program.  Would you or anybody happen to know which version control works best on a simple single PC (as opposed to a networked system). I just need something very simple to image my code every so often.   Also, do any of those programs have an option or utility to compare the difference in two .hex files.  I have been looking for a solid method that would show the changes in a .hex file after a code change and compile.
    #3
    Jim Nickerson
    User 452
    • Total Posts : 5956
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: offline
    Re: Possible Rapid Archive Method while developing in MPLABx 2019/02/18 10:41:46 (permalink)
    +2 (2)
    I make use of the built in history as a first means of backup.
    I make use of git for version control on my local PC
    I make use of BitBucket/ GitHub for free off site git backup
    Attachments are not available: Download requirements not met
     

    Attachment(s)

    Attachments are not available: Download requirements not met
    #4
    KTrenholm
    Super Member
    • Total Posts : 707
    • Reward points : 0
    • Joined: 2012/08/08 14:04:23
    • Location: Connecticut, USA
    • Status: offline
    Re: Possible Rapid Archive Method while developing in MPLABx 2019/02/18 11:15:11 (permalink)
    +1 (1)
    CNS
    Mysil, thank you.  I had tried the package command some time back but I had experienced a problem and thus had resulted to copying the whole file structure because I needed a solid backup method. I just used it and it now works.
     
    I will also research a version control program.  Would you or anybody happen to know which version control works best on a simple single PC (as opposed to a networked system). I just need something very simple to image my code every so often.   Also, do any of those programs have an option or utility to compare the difference in two .hex files.  I have been looking for a solid method that would show the changes in a .hex file after a code change and compile.




    Something like WinMerge or KDiff would be able to compare hex files, and any other text based file for that matter.
    If you use something like Subversion/Mercurial for source control, you can quickly compare source files to see what changed between your revisions using your diff program of choice.
     
    I used Subversion (TortoiseSVN - https://tortoisesvn.net/ ) for a while and it worked pretty well for me as a single user.
     
    I use Mercurial (TortoiseHg - https://tortoisehg.bitbucket.io/ )now, but that was a choice to match what the other software guys in the company are using (so we could avoid any mixing of source control methods) even though I'm the only one that touches my code.
    post edited by KTrenholm - 2019/02/18 11:22:58
    #5
    mlp
    boots too small
    • Total Posts : 751
    • Reward points : 0
    • Joined: 2012/09/10 15:12:07
    • Location: previously Microchip XC8 team
    • Status: offline
    Re: Possible Rapid Archive Method while developing in MPLABx 2019/02/18 11:47:04 (permalink)
    +1 (1)
    CNS
    Also, do any of those programs have an option or utility to compare the difference in two .hex files.  I have been looking for a solid method that would show the changes in a .hex file after a code change and compile.

    As noted by KTrenholm, a .hex file is just a text file and any text-file comparison utility will show you changes. But viewing the changes in a .hex is unlikely to be useful except in the most trivial of cases (e.g. where only the contents of some string literals or other constants have been changed) because of the way small changes in C source code can become quite extensive changes in the resulting machine code.

    Although if you're developing in assembly, changes in the .hex file will much more closely reflect changes in your source.

    Mark (this opinion available for hire)
    #6
    CNS
    New Member
    • Total Posts : 20
    • Reward points : 0
    • Status: offline
    Re: Possible Rapid Archive Method while developing in MPLABx 2019/02/18 15:30:10 (permalink)
    +1 (1)
    Thanks Jim, I need to investigate this feature of MPLAB.  I have to say I didn't know about it. I assume it is pushing a history file into a folder when it is enabled.
    #7
    CNS
    New Member
    • Total Posts : 20
    • Reward points : 0
    • Status: offline
    Re: Possible Rapid Archive Method while developing in MPLABx 2019/02/18 15:31:42 (permalink)
    0
    KTrenholm, I need to look at these. I think I'm leaning towards subversion. Thanks for your input.
     
    #8
    CNS
    New Member
    • Total Posts : 20
    • Reward points : 0
    • Status: offline
    Re: Possible Rapid Archive Method while developing in MPLABx 2019/02/18 15:34:57 (permalink)
    0
    In my case I was wanting to look at the way data structures are stored and or changed inside the hex file.  Thanks for your help
     
    #9
    Jim Nickerson
    User 452
    • Total Posts : 5956
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: offline
    Re: Possible Rapid Archive Method while developing in MPLABx 2019/02/19 08:29:12 (permalink)
    0
    CNS
    Thanks Jim, I need to investigate this feature of MPLAB.  I have to say I didn't know about it. I assume it is pushing a history file into a folder when it is enabled.




    Yes it does
    In my case I set a separate user dir for each version MpLab X I have
    Attachments are not available: Download requirements not met
     

    Attachment(s)

    Attachments are not available: Download requirements not met
    #10
    CNS
    New Member
    • Total Posts : 20
    • Reward points : 0
    • Status: offline
    Re: Possible Rapid Archive Method while developing in MPLABx 2019/02/19 19:34:13 (permalink)
    +1 (1)
    JANickerson
    CNS
    Thanks Jim, I need to investigate this feature of MPLAB.  I have to say I didn't know about it. I assume it is pushing a history file into a folder when it is enabled.




    Yes it does
    In my case I set a separate user dir for each version MpLab X I have

     


    I'm not sure where that xml is, my file structure is apparently not the same
     
    #11
    Jim Nickerson
    User 452
    • Total Posts : 5956
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: offline
    Re: Possible Rapid Archive Method while developing in MPLABx 2019/02/20 09:14:40 (permalink)
    0
    I do not doubt your file structure is different.
    step 1 determine where your user dir is from MpLab X, help, about and start there
    Attachments are not available: Download requirements not met
     

    Attachment(s)

    Attachments are not available: Download requirements not met
    #12
    CNS
    New Member
    • Total Posts : 20
    • Reward points : 0
    • Status: offline
    Re: Possible Rapid Archive Method while developing in MPLABx 2019/02/20 19:26:19 (permalink)
    0
    I looked in my appdata.../var and there's no history files.  I'm a little ashamed to say, I am apparently only using ver5.1 while I think you must be running 10.  However, if I right click on project, source, etc and HISTORY I am starting to learn how to use HISTORY in the IDE, just unsure where file is stored.
    #13
    Jim Nickerson
    User 452
    • Total Posts : 5956
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: offline
    Re: Possible Rapid Archive Method while developing in MPLABx 2019/02/21 07:53:47 (permalink)
    0
    Ok, now "appdata…/var/filehistory" and look for the most recent.
    If right clicking on a source and History is available I find the file is there
     
    #14
    malaugh
    Super Member
    • Total Posts : 396
    • Reward points : 0
    • Joined: 2011/03/31 14:04:42
    • Location: San Diego
    • Status: offline
    Re: Possible Rapid Archive Method while developing in MPLABx 2019/02/21 15:15:04 (permalink)
    +2 (2)
    CNS
    Does anybody see a problem with this new custom backup (archive) method.  In the past I had been copying the whole project directory that lived directly under my MPLABProjects folder. Recently to organize my projects better, I had made an additional sub project folder "HVAC".   I am basically now using the project MyHVAC_Ver01 for ongoing development. Every so many hours(or minutes) I simply copy the project back into the HVAC folder (where it becomes folder (1), (2), etc).  If something blows-up in my code development, I can revert back to a the most recent ....copy(x).  I am using the SOURCE | FORMAT command to recursively format to allow a clean compile in the newly copied archive folder.  I'm not sure if the source-format is even meant to be used this way.....So, my question, is please review the attached and give advice if this is an acceptable way to fix the file path issues that is a result of copying the whole project.



    I would recommend you use a version control system rather than your custom archive method.  Version control systems have much better feature when it comes to seeing what changes and reverting back to an older version of your changes do not work.  In my work we use subversion.  You can set this up really easily on your PC, get a copy of visual SVN server https://www.visualsvn.com/server/  as the server, and https://tortoisesvn.net/ as your client.  The client installs as a right click menu on a PC, so to archive, you just need to right click, and hit commit.  I think this will be the simplest for your need as single designer on one PC.  I would recommend as an enhancement to run the server on a different computer, or sign up with a SVN service provider.
     
    The set-up I use at home is exactly what I described, except I have a Synology NAS running VisualSVN as my server, set up with dual redundant disks so I do not loose my work.
     
     
     
    #15
    moser
    Super Member
    • Total Posts : 468
    • Reward points : 0
    • Joined: 2015/06/16 02:53:47
    • Location: Germany
    • Status: online
    Re: Possible Rapid Archive Method while developing in MPLABx 2019/02/27 06:34:35 (permalink)
    +3 (3)
    I also recommend using a version control system. I'm using Git (for Windows) together with TortoiseGit. And I am quite happy with it. From MPLAB X I only use the Diff (coloring of inserted/changed/deleted lines) which is automatically enabled. For everything else I use TortoiseGit. I usually don't use the command line.
     
    There is a nice thread, which discusses several advantages and disadvantages of the different version control systems, also in respect to different needs and requirements:
     
    [Development Tools] » MPLAB X IDE » Version Control for MPLAB C Code
    https://www.microchip.com/forums/FindPost/1063982
    #16
    cTucker
    New Member
    • Total Posts : 10
    • Reward points : 0
    • Joined: 2014/04/14 13:51:49
    • Location: 0
    • Status: offline
    Re: Possible Rapid Archive Method while developing in MPLABx 2019/02/28 12:03:30 (permalink)
    0
    Hello CNS,
     
    I might be misunderstanding the question.
     
    Addressing the first part of the question. My suggestion is to Right Click on your Project within MPLAB X, and select the "package" option.
    This will create a local zip package inside the .X project folder. it will bring in the source files, project settings, etc which are required to "ship", or "tag" a version of code. It WILL NOT include a lot of IDE specifics which typically result in "Broken" projects when trying to copy and paste raw project files.
     
    But it I am interpreting this overall as asking about improving your process of Revision Control.
    My preferred method is Git, using the GitFlow concept.
    This can be confusing at first, but empowering once you Git it.
    Its much easier to understand if only 1 person is touching files at a time, but truly shines when working across a group. 
    #17
    Jump to:
    © 2019 APG vNext Commercial Version 4.5