Index: trunk/src/org/openstreetmap/josm/actions/CombineWayAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/CombineWayAction.java	(revision 8180)
+++ trunk/src/org/openstreetmap/josm/actions/CombineWayAction.java	(revision 8181)
@@ -95,5 +95,6 @@
 
     /**
-     * @param ways
+     * Combine multiple ways into one.
+     * @param ways the way to combine to one way
      * @return null if ways cannot be combined. Otherwise returns the combined
      *              ways and the commands to combine
@@ -114,5 +115,5 @@
         // ways
         //
-        NodeGraph graph = NodeGraph.createUndirectedGraphFromNodeWays(ways);
+        NodeGraph graph = NodeGraph.createNearlyUndirectedGraphFromNodeWays(ways);
         List<Node> path = graph.buildSpanningPath();
         if (path == null) {
@@ -421,4 +422,9 @@
         }
 
+        /**
+         * Create an undirected graph from the given ways.
+         * @param ways Ways to build the graph from
+         * @return node graph structure
+         */
         public static NodeGraph createUndirectedGraphFromNodeList(List<NodePair> pairs) {
             NodeGraph graph = new NodeGraph();
@@ -430,8 +436,31 @@
         }
 
+        /**
+         * Create an undirected graph from the given ways, but prevent reversing of all
+         * non-new ways by fix one direction.
+         * @param ways Ways to build the graph from
+         * @return node graph structure
+         * @since 8181
+         */
         public static NodeGraph createUndirectedGraphFromNodeWays(Collection<Way> ways) {
+            boolean dir = true;
             NodeGraph graph = new NodeGraph();
             for (Way w: ways) {
                 graph.add(buildNodePairs(w, false /* undirected */));
+            }
+            return graph;
+        }
+
+        public static NodeGraph createNearlyUndirectedGraphFromNodeWays(Collection<Way> ways) {
+            boolean dir = true;
+            NodeGraph graph = new NodeGraph();
+            for (Way w: ways) {
+                if(!w.isNew()) {
+                    /* let the first non-new way give the direction (see #5880) */
+                    graph.add(buildNodePairs(w, dir));
+                    dir = false;
+                } else {
+                    graph.add(buildNodePairs(w, false /* undirected */));
+                }
             }
             return graph;
@@ -604,5 +633,5 @@
         /**
          * Tries to find a path through the graph which visits each edge (i.e.
-         * the segment of a way) exactly one.
+         * the segment of a way) exactly once.
          *
          * @return the path; null, if no path was found
