Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how do i know if my working copy is out of sync

Tags:

svn

We keep a image of current release code in some local directory and for building the code we use the code in this directory. In the build script, I need a way to figure out if the code in image directory in sync with the current release branch in repository. If it is so, I will do a svn update from within script. Can the revision numbers be somehow used to detect the out of sync condition? If so how?

Vadiraj

like image 836
vadiraj Avatar asked Jun 29 '11 05:06

vadiraj


People also ask

How do I know when sync is syncing?

Sync displays icon overlays on files, folders and the Sync icon on your system tray (Windows) or menu bar (Mac). You’ll know when syncing is taking place when the Sync icon on your system tray or menu bar spins.

How do I know if G-Sync is working on Windows 10?

Checking if G-Sync is Working If you are wondering how to tell if Gsync is on for the game that you are currently playing, from the Nvidia Control Panel menu bar, click Display and then select show indicator for G-Sync. The indicator will show up on the screen to show whether or not G-Sync is turned on.

What does the padlock icon next to the sync status mean?

File locked padlock icon OneDrive will show a padlock icon next to the sync status if the file or folder has settings which prevent it from syncing. Learn more about restrictions and limitations when you sync files and folders. Flashing OneDrive icon in Android

Why is there a padlock next to my OneDrive sync status?

OneDrive will show a padlock icon next to the sync status if the file or folder has settings which prevent it from syncing. Learn more about restrictions and limitations when you sync files and folders. Flashing OneDrive icon in Android The OneDrive cloud icon may briefly appear in your Android notifications as part of the normal upload process.


1 Answers

svn status -u

adds working revision and server out-of-date information.

If you don't have non-versioned files in the directory then it's up to date only if the status command returns nothing. Otherwise * means it's not up to date, ? means non-versioned, M - modified, etc.

In other words it's up to date if and only if the following returns 0:

svn status -u | grep -E -c "^\s+[^\?]"
like image 156
Petar Ivanov Avatar answered Nov 03 '22 20:11

Petar Ivanov