User Tools

Site Tools


windows:hgsync

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
windows:hgsync [2021/10/20 14:59]
tschulz [hgsync_login.cmd]
windows:hgsync [2021/10/20 16:14]
tschulz [userkeygen.sh]
Line 166: Line 166:
 </​code>​ </​code>​
  
-==== hgsync_logout.cmd ==== 
- 
-<code batch hgsync_logout.cmd>​ 
-@echo off 
-set LOCAL_REPO="​%USERPROFILE%\Documents"​ 
-set REMOTE_REPO="​h:​\Documents"​ 
-set PATH=C:​\Progra~1\Mercurial;​C:​\Windows\System32\OpenSSH;​ 
- 
-If exist "​%LOCAL_REPO%\.hg"​ ( 
-    If exist "​%REMOTE_REPO%\.hg"​ ( 
- goto Remoteandlocal 
- ) else ( 
- goto onlylocal 
- ) 
-) else If exist "​%REMOTE_REPO%\.hg"​ ( 
-    goto onlyremote 
-) else If exist "​%LOCAL_REPO%\.hg"​ ( 
- goto onlylocal 
-) else ( 
- goto missingonboth 
-) 
- 
- 
- 
- 
-:​Remoteandlocal 
-Echo File exist remote and local 
-c: 
-cd %LOCAL_REPO% 
-hg addremove 
-hg --config ui.username=%USERNAME% commit -m "​update from %COMPUTERNAME%"​ 
-hg pull  %REMOTE_REPO% 
-hg merge -t "​W:​\scripts\merge_other.bat"​ 
-hg resolve -t internal:​local --all 
-hg update 
-hg addremove 
-hg --config ui.username=%USERNAME% commit -m "merge update from %COMPUTERNAME%"​ 
-hg push  %REMOTE_REPO% 
-h: 
-cd %REMOTE_REPO% 
-hg --config ui.username=%USERNAME% commit -m "merge update from %COMPUTERNAME%"​ 
-hg merge -t "​W:​\scripts\merge.bat"​ 
-hg resolve -t internal:​other --all 
-hg update 
-hg addremove 
-hg --config ui.username=%USERNAME% commit -m "merge update from %COMPUTERNAME%"​ 
-c: 
-cd %LOCAL_REPO% 
-hg pull  %REMOTE_REPO% 
-hg update 
-goto END 
- 
-:onlylocal 
-Echo File exist only local 
-mkdir %REMOTE_REPO% 
-H: 
-cd %REMOTE_REPO% 
-hg init 
-c: 
-cd %LOCAL_REPO% 
-hg addremove 
-hg --config ui.username=%USERNAME% commit -m "​update from %COMPUTERNAME%"​ 
-hg push  %REMOTE_REPO% 
-H: 
-cd %REMOTE_REPO% 
-hg addremove 
-hg --config ui.username=%USERNAME% commit -m "​remote update from %COMPUTERNAME%"​ 
-hg merge -t "​W:​\scripts\merge.bat"​ 
-hg resolve -t internal:​other --all 
-hg update 
-hg addremove 
-hg --config ui.username=%USERNAME% commit -m "​remote merge update from %COMPUTERNAME%"​ 
-c: 
-cd %LOCAL_REPO% 
-hg pull  %REMOTE_REPO% 
-hg merge -t "​W:​\scripts\merge_other.bat"​ 
-hg resolve -t internal:​local --all 
-hg update 
-hg addremove 
-hg --config ui.username=%USERNAME% commit -m "merge update from %COMPUTERNAME%"​ 
-hg push %REMOTE_REPO% 
-h: 
-cd %REMOTE_REPO% 
-hg update 
-goto END 
- 
-:onlyremote 
-Echo File exist only remote 
-c: 
-cd %LOCAL_REPO% 
-hg init 
-hg pull  %REMOTE_REPO% 
-hg addremove 
-hg --config ui.username=%USERNAME% commit -m "​update from %COMPUTERNAME%"​ 
-hg merge -t "​W:​\scripts\merge_other.bat"​ 
-hg resolve -t internal:​local --all 
-hg update 
-hg addremove 
-hg --config ui.username=%USERNAME% commit -m "merge update from %COMPUTERNAME%"​ 
-hg push %REMOTE_REPO% 
-h: 
-cd %REMOTE_REPO% 
-hg update 
-goto END 
- 
-:​missingonboth 
-Echo missing on both 
-mkdir %LOCAL_REPO% 
-C: 
-cd %LOCAL_REPO% 
-hg init 
-mkdir %REMOTE_REPO% 
-H: 
-cd %REMOTE_REPO% 
-hg init 
-c: 
-cd %LOCAL_REPO% 
-hg addremove 
-hg --config ui.username=%USERNAME% commit -m "​update from %COMPUTERNAME%"​ 
-hg push %REMOTE_REPO% 
-H: 
-cd %REMOTE_REPO% 
-hg addremove 
-hg --config ui.username=%USERNAME% commit -m "​remote update from %COMPUTERNAME%"​ 
-hg merge -t "​W:​\scripts\merge.bat"​ 
-hg resolve -t internal:​other --all 
-hg update 
-hg addremove 
-hg --config ui.username=%USERNAME% commit -m "​remote merge update from %COMPUTERNAME%"​ 
-c: 
-cd %LOCAL_REPO% 
-hg pull  %REMOTE_REPO% 
-hg merge -t "​W:​\scripts\merge_other.bat"​ 
-hg resolve -t internal:​local --all 
-hg update 
-hg addremove 
-hg --config ui.username=%USERNAME% commit -m "merge update from %COMPUTERNAME%"​ 
-hg push %REMOTE_REPO% 
-h: 
-cd %REMOTE_REPO% 
-hg update 
-goto END 
- 
-:END 
-echo done 
-</​code>​ 
  
 ==== hgsync_logout_ssh.cmd ==== ==== hgsync_logout_ssh.cmd ====
Line 478: Line 332:
         ssh-keygen -t rsa -N ""​ -f id_rsa         ssh-keygen -t rsa -N ""​ -f id_rsa
         cp id_rsa.pub authorized_keys         cp id_rsa.pub authorized_keys
-        ​cd ${USERHOME} +        ​chmod -R 700 ${USERHOME} 
-        chown -R ${PAM_USER} ${USERHOME}/.ssh +        chown -R ${PAM_USER} ${USERHOME} 
-        chmod 700 .ssh+
 else else
         echo "Keys Present"​         echo "Keys Present"​
-        chown -R ${PAM_USER} ${USERHOME}/​.ssh +        ​#chown -R ${PAM_USER} ${USERHOME}/​.ssh 
-        chmod 700 .ssh+        ​#chmod 700 .ssh 
 +        chmod -R 700 ${USERHOME} 
 +        chown -R ${PAM_USER} ${USERHOME} 
 fi fi
 </​code>​ </​code>​
windows/hgsync.txt · Last modified: 2021/10/20 16:14 by tschulz