1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Read this or you will lost your precious code

Discussion in 'General Programming Chat' started by cbnoob, Dec 4, 2012.

Tags:
  1. cbnoob

    cbnoob Senior Member

    Joined:
    Sep 27, 2010
    Messages:
    967
    Likes Received:
    455
    Hi all,

    Earlier today when I was coding, suddenly there was a power outage. After that, when I turned on the computer, I check my code and I was very surprise to see all the codes were gone. I saved the files before and I didn't understand why but codes were gone. Luckily, I have tortoise SVN so it was easy to get part of the code back but I lost the part which I didn't commit.

    If anyone doesn't know about SVN, search google for it. If you are using SVN, read on. Committing is quite a nuisance since you have to go to the folder, right click and select commit. So I think it would be nice to have a hotkey to do this when I am coding and I've found a way to do it by using autohotkey. Here is the code for you:

    ^!c::
    run C:/Program Files/TortoiseSVN/bin/TortoiseProc.exe /command:commit /path:"path to the folder you want to commit" /closeonend:1
    return

    The green part is the path to the file TortoiseProc.exe , the red part is the path to the folder you want to commit, the ^!c is the hotkey I set myself, you can change it to any key you want. (^ for ctrl, ! for alt, in this case, my hotkey is Ctrl+Alt+C to trigger the commit window).

    So that's it. I found this is just great for me to prevent loss of code which I haven't committed yet. I hope it will be useful to you too.

    Have a good day
     
    • Thanks Thanks x 1
  2. AdGate

    AdGate Jr. VIP Jr. VIP Premium Member

    Joined:
    Feb 23, 2011
    Messages:
    179
    Likes Received:
    37
    Home Page:
    Committing code isn't too bad. I use github, it's a very easy process.
     
  3. cbnoob

    cbnoob Senior Member

    Joined:
    Sep 27, 2010
    Messages:
    967
    Likes Received:
    455
    I haven't used github yet but I find myself usually forget to commit with tortoisesvn so using hotkey works well for me
     
  4. Blackberry_11

    Blackberry_11 Regular Member

    Joined:
    Apr 17, 2011
    Messages:
    266
    Likes Received:
    19
    Pressed thanks for you ,
    but please share the algorithm and code.