[Unison-hackers] [unison-svn] r492 - branches/2.45/src

schmitta at seas.upenn.edu schmitta at seas.upenn.edu
Fri Apr 6 11:07:21 EDT 2012


Author: schmitta
Date: 2012-04-06 11:07:20 -0400 (Fri, 06 Apr 2012)
New Revision: 492

Modified:
   branches/2.45/src/RECENTNEWS
   branches/2.45/src/mkProjectInfo.ml
   branches/2.45/src/os.ml
Log:
- fix a bug in the lookup of the remote host name


Modified: branches/2.45/src/RECENTNEWS
===================================================================
--- branches/2.45/src/RECENTNEWS	2012-04-02 16:01:55 UTC (rev 491)
+++ branches/2.45/src/RECENTNEWS	2012-04-06 15:07:20 UTC (rev 492)
@@ -1,3 +1,8 @@
+CHANGES FROM VERSION 2.45.4
+
+- fix a bug in the lookup of the remote host name
+
+-------------------------------
 CHANGES FROM VERSION 2.45.-1
 
 * Bit more preparation for beta release

Modified: branches/2.45/src/mkProjectInfo.ml
===================================================================
--- branches/2.45/src/mkProjectInfo.ml	2012-04-02 16:01:55 UTC (rev 491)
+++ branches/2.45/src/mkProjectInfo.ml	2012-04-06 15:07:20 UTC (rev 492)
@@ -67,3 +67,4 @@
 
 
 
+

Modified: branches/2.45/src/os.ml
===================================================================
--- branches/2.45/src/os.ml	2012-04-02 16:01:55 UTC (rev 491)
+++ branches/2.45/src/os.ml	2012-04-06 15:07:20 UTC (rev 492)
@@ -24,18 +24,21 @@
 (* Assumption: Prefs are not loaded on server, so clientHostName is always *)
 (* set to myCanonicalHostName. *)
     
+let localCanonicalHostName =
+  try System.getenv "UNISONLOCALHOSTNAME"
+  with Not_found -> Unix.gethostname()
+
 let clientHostName : string Prefs.t =
-  let myCanonicalHostName =
-    try System.getenv "UNISONLOCALHOSTNAME"
-    with Not_found -> Unix.gethostname()
-  in
-  Prefs.createString "clientHostName" myCanonicalHostName
+  Prefs.createString "clientHostName" localCanonicalHostName
     "!set host name of client"
     ("When specified, the host name of the client will not be guessed" ^
      "and the provided host name will be used to find the archive.")
 
-let myCanonicalHostName () = Prefs.read clientHostName
+let serverHostName = localCanonicalHostName
 
+let myCanonicalHostName () =
+  if !Trace.runningasserver then serverHostName else Prefs.read clientHostName
+
 let tempFilePrefix = ".unison."
 let tempFileSuffixFixed = ".unison.tmp"
 let tempFileSuffix = ref tempFileSuffixFixed



More information about the Unison-hackers mailing list